Actions
Bug #557
closedRegexp does not match longest string
Description
=begin
Regexp does not match the longest string, as do regular expression for Linux (or posix).
For example:
irb(main):001:0> r=/foo|footer/
=> /foo|footer/
irb(main):002:0> r.match('footer').offset(0)
=> [0, 3]
The same thing in C (see attachment), results in
match: 0, 6
=end
Files
Updated by shyouhei (Shyouhei Urabe) about 16 years ago
- Status changed from Open to Closed
=begin
Not a bug. Leftmost match is preferred.
% echo 'footer' | perl -pe 's/foo|footer/($&)/;'
(foo)ter
=end
Actions
Like0
Like0