As others have suggested a positive look ahead match ((?=...) is likely to be a key to solving your unspecified problem. We may be able to help better if you let us know what the higher level problem is that you are trying to solve.
In reply to Re: regex greediness
by GrandFather
in thread regex greediness
by Danny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |