in reply to regex finding shortest string containing n of $c
Your expected results do not match your description - I would have expected line 4 to contain 4 x's.
It is not obvious that the longest string will be bounded by $c. Or do you mean that the longest string must be terminated at each end by $c such that, if $n == 1, then ".....x......" is not acceptable, but 'x' is?
I doubt that using a regex is the most efficient way to solve this. Is it a requirement?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex finding longest string containing n of $c
by xipho (Scribe) on Sep 01, 2005 at 04:03 UTC | |
by GrandFather (Saint) on Sep 01, 2005 at 04:20 UTC |