Skip to content

Instantly share code, notes, and snippets.

@erikhazzard
Created January 13, 2012 18:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erikhazzard/1607920 to your computer and use it in GitHub Desktop.
Save erikhazzard/1607920 to your computer and use it in GitHub Desktop.
here's some regex
a = '<span>Abelmoschus esculentus</span><a href="#" class="search-choice-close" rel="1"></a>';
b = a.replace(/<[\/]?span>/g,'');
final_string = b.replace(/<a.*$/g,'');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment