This is better handled with XPath.
m( <pg [^>]* > # A <pg> tag with optional body ( # Capture START (?: # Skip past all the non-tag-beginng-like things but be sure # not to allow backtracking. (?> [^<]+ ) | # OR # Match something like a tag beginning as long as it # isn't an opening for <pg < (?! pg\s ) ) ) # Capture END </pg> )x;
In reply to Re: regex using negative look ahead assertion
by diotalevi
in thread regex using negative look ahead assertion
by prasadbabu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |