The greediness of \$+ has nothing to do with the observed behavior, and making it non-greedy doesn't help the situation. The "problem" is strictly the optional nature of the X?.
In reply to Re: Re: Re: Re: Capturing everything after an optional character in a regex?
by Anonymous Monk
in thread Capturing everything after an optional character in a regex?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |