Okay, that's not a big win for much besides readability, but it could help non-regex-gurus. It was kinda neat to write, too. It's a little long to post here, but it would be great to get some feedback. I'll keep updating the module on my site.my $time; my $re = Regex::English -> start_of_line() -> literal("1998/10/08") -> optional( whitespace() ) -> literal("[") -> remember(\$time, many( or( ":", digit() ) )) -> non_digit(); if ($re->match('1998/10/08 [11:10]')) { print "Found a match at time $time!\n"; }
Feedback, suggestions, patches, questions are all welcome. It'd be cool to have a preliminary upload to the CPAN by this weekend.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pondering Regex::English
by TheDamian (Vicar) on Aug 24, 2001 at 10:48 UTC | |
|
Re: Pondering Regex::English
by VSarkiss (Monsignor) on Aug 24, 2001 at 06:19 UTC | |
|
Re (tilly) 1: Pondering Regex::English
by tilly (Archbishop) on Aug 24, 2001 at 03:47 UTC | |
by Ovid (Cardinal) on Aug 24, 2001 at 03:58 UTC | |
by japhy (Canon) on Aug 24, 2001 at 04:09 UTC | |
by dws (Chancellor) on Aug 24, 2001 at 05:55 UTC | |
by stefp (Vicar) on Aug 25, 2001 at 00:00 UTC | |
by chromatic (Archbishop) on Aug 24, 2001 at 05:04 UTC | |
by tilly (Archbishop) on Aug 24, 2001 at 05:45 UTC |