Skip to content
Prev 347154 / 398498 Next

regular expression question

Hi Mark,

Mark Leeds <markleeds2 at gmail.com> writes:
The matching of the initial .* is by default greedy, so it will match
everything before the last 'n' or 'r'.  As you always have an 'r' in
'rho', your 'no' gets eaten by the first pattern.  You can make a
pattern non-greedy by appending '?' to the quantifier.

I would do
[1] "lngimbint"   "lngimbnoint" "test"

Cheers,

Loris