Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- </?(?:(?!pb)[^>])*>
- < # "<"
- /? # optional "/"
- (?: # don't capture group
- (?! # a position not followed by...
- pb # "p" and a word bounday
- )
- [^>]* # any char but ">"
- )* # as often as possible
- > # ">"
- <p class="foo" title="unusual < title">
- ---------
- var html = '<img src=""><p>content</p><span style="color: red">content</span>';
- html.replace(/<(?!s*/?s*pb)[^>]*>/gi,'')
Add Comment
Please, Sign In to add comment