I may have misunderstood what you are asking for, but I think the solution to your problem is look-ahead assertions.
m< (?: # A char that is: [^\$] # Not a $ | # Or \$ (?! {= ) # A $ not followed by {= )+ # Many times >x;
In reply to Re: Regex matching next occurrence or to the end of line.
by Eily
in thread Regex matching next occurrence or to the end of line.
by nabeenj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |