Skip to content

Instantly share code, notes, and snippets.

@devpruthvi
Created June 23, 2015 12:24
Show Gist options
  • Select an option

  • Save devpruthvi/19bfd8d5a30c8a13b331 to your computer and use it in GitHub Desktop.

Select an option

Save devpruthvi/19bfd8d5a30c8a13b331 to your computer and use it in GitHub Desktop.
str = '[quote][quote]Hi[/quote] Hello[/quote]';
regexp = /\[quote\](.*)\[\/quote\]/;
while(str.indexOf('[quote]') != -1)
{
str = str.replace(regexp,'<div class="quote">$1</div>');
}
document.writeln(str);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment