Skip to content

Instantly share code, notes, and snippets.

@kanakiyajay
Created August 27, 2014 07:36
Show Gist options
  • Save kanakiyajay/f8a015dff6750570238f to your computer and use it in GitHub Desktop.
Save kanakiyajay/f8a015dff6750570238f to your computer and use it in GitHub Desktop.
Angular: Regex to search for html tags
var SINGLE_TAG_REGEXP = /^<(\w+)\s*\/?>(?:<\/\1>|)$/;
var HTML_REGEXP = /<|&#?\w+;/;
var TAG_NAME_REGEXP = /<([\w:]+)/;
var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment