[Issue 2108] New: regexp.d: The greedy dotstar isn't so greedy
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed May 14 21:09:56 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2108
Summary: regexp.d: The greedy dotstar isn't so greedy
Product: D
Version: 2.012
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: bugzilla at digitalmars.com
ReportedBy: nyphbl8d at gmail.com
As far as I'm aware, ".*" should be greedy by default and become non-greedy
when changed to ".*?". As it stands now, both ".*" and ".*?" are non-greedy
when it comes to std.regexp and I have found no way to make ".*" greedy, flags
or otherwise. This can be seen by using
"<packet>text</packet><packet>text</packet>" as the buffer to match against and
"<packet.*/packet>" as the pattern. When I use this with std.regexp.search, it
only matches the first opening and closing tag instead of the outer set. I
just hope this isn't my lack of regex-fu coming back to haunt me.
--
More information about the Digitalmars-d-bugs
mailing list