A regex is not going to do it for you because it will find the first match regardless of the length of the match. If you need to find the shortest (or longest) match then you need to find all the matches and select the best. A regex on it's own generally doesn't do that.
In reply to Re^3: regex finding longest string containing n of $c
by GrandFather
in thread regex finding shortest string containing n of $c
by xipho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |