builtin regular expressions?
MonkeeSage at gmail.com
Sun Oct 1 02:15:08 CEST 2006
Roy Smith wrote:
> More to the point:
> You can stick it in a bottle, you can hold it in your hand, AMEN!
That's simply an implementation detail of perl regexps; it doesn't
really address the issue. For example, in ruby a regexp is an object.
Matches are also objects when one uses the String#match and
Regexp#match methods rather than the =~ operator:
s = 'file=blah.txt'
r = /file=(.*)/
# => (?-mix:file=(.*))
m = s.match(r)
# => #<MatchData:0xb7c24f90>
m = r.match(s)
# => #<MatchData:0xb7c24e64>
More information about the Python-list