I want to NOT have a two character patern in the middle part.
(?!re).
is for regexps what
[^a]
is for characters. So
(?(?!re).)*
would restrict the presence of the regexp like
[^a]*
would restrict the presence of characters where .* would otherwise be used.
You can combine this trick with the code in the example for (??{...}) in perlre (which handles nested parens).
In reply to Re: need regex help to strip things like embedded C comments
by ikegami
in thread need regex help to strip things like embedded C comments
by Eradicatore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |