RSS

Insert dynamic regular expression to replace string in javascript

27 May

Insert Regular Expression dynamically to replace string in javascript.

var regex = new RegExp('nornaml_'+(dynamicValue), 'g');
replaceString.replace(regex, "Replace Value");
 
Leave a comment

Posted by on May 27, 2014 in General

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: