|
Posted by A. Sinan Unur on April 15, 2008, 7:44 pm
Please log in for more thread options
> _
> Robbie Hatley (see.my.signature@for.my.email.address) wrote on
> VCCCXLI September MCMXCIII in
...
> `' Unless someone knows a better approach.
>
>
> You mean, something like:
>
> (?:(?:(?:http)://(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a
<snipped for brevity>
OK, now you are just showing off ;-)
Joking aside, that giant block shows the utility of building regular
expressions from small building blocks.
In any case, I would like to take this opportunity to thank you
for Regexp::Common. It has saved me a lot of work over time.
The OP would benefit from using
http://search.cpan.org/~abigail/Regexp-Common-2.120/lib/Regexp/Common/URI.pm
as opposed to resigning himself to second or third or nth rate
'solutions'.
Thank you.
Sinan
--
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
|
|
Posted by Robbie Hatley on April 15, 2008, 8:28 pm
Please log in for more thread options
"Abigail" put forth into the annals of Usenet:
> (a rather large URL-capturing regex)
Hmmm... I'm curious, did you write that manually, or generate it
programmatically? If generated, using what software?
And how many decaseconds does it take a regex compiler to process
that?
> I don't believe in capturing a few invalid ones - nor in
> rejected valid ones.
I believe in simplicity over perfection. Given these choices:
A. Make a 100% perfect program taking 284 man-hours
B. Make a 97% perfect program taking 5 man-hours
I usually take B.
--
perl -le 'print "27b21e01t45y";'
perl -le 'print "45s41n3A53A";'
perl -le 'print "4one7olf07ell3om\n";'
perl -le 'print scalar reverse "/flowenol~/moc.llew.www//ptth";'
|
|
Posted by A. Sinan Unur on April 15, 2008, 8:50 pm
Please log in for more thread options
>
> "Abigail" put forth into the annals of Usenet:
>
>> (a rather large URL-capturing regex)
>
> Hmmm... I'm curious, did you write that manually, or generate it
> programmatically? If generated, using what software?
You can read how it is done by looking at the sources of
Regexp::Common modules. It is very elegant.
> And how many decaseconds does it take a regex compiler to process
> that?
Not so much that it matters. You might want to measure performance if
you care so much.
>> I don't believe in capturing a few invalid ones - nor in
>> rejected valid ones.
>
> I believe in simplicity over perfection. Given these choices:
> A. Make a 100% perfect program taking 284 man-hours
> B. Make a 97% perfect program taking 5 man-hours
> I usually take B.
But, of course, using Regexp::Common would have cut that down to 2
minutes for a perfect program.
Sinan
--
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
|
|
Posted by Robbie Hatley on April 16, 2008, 3:49 pm
Please log in for more thread options
"A. Sinan Unur" wrote:
> "Robbie Hatley" wrote:
>
> > "Abigail" put forth into the annals of Usenet:
> >
> >> (a rather large URL-capturing regex)
> >
> > Hmmm... I'm curious, did you write that manually, or generate it
> > programmatically? If generated, using what software?
>
> You can read how it is done by looking at the sources of
> Regexp::Common modules. It is very elegant.
Ok, will do.
> ... using Regexp::Common would have cut that down to 2
> minutes for a perfect program ...
I'll try that.
Ok, I just downloaded Regexp-Common-2.120. Now I have a folder
with a bunch of stuff in it. This may sound like an incredibly
stupid question, but what do I do with it? I've never actually
used a CPAN module before. Any hints a CPAN newbie should be
aware of?
--
Cheers,
Robbie Hatley
lonewolf aatt well dott com
www dott well dott com slant user slant lonewolf slant
|
|
Posted by Abigail on April 16, 2008, 4:47 pm
Please log in for more thread options _
Robbie Hatley (see.my.signature@for.my.email.address) wrote on VCCCXLII
,,
,, "A. Sinan Unur" wrote:
,,
,, > "Robbie Hatley" wrote:
,, >
,, > > "Abigail" put forth into the annals of Usenet:
,, > >
,, > >> (a rather large URL-capturing regex)
,, > >
,, > > Hmmm... I'm curious, did you write that manually, or generate it
,, > > programmatically? If generated, using what software?
,, >
,, > You can read how it is done by looking at the sources of
,, > Regexp::Common modules. It is very elegant.
,,
,, Ok, will do.
,,
,, > ... using Regexp::Common would have cut that down to 2
,, > minutes for a perfect program ...
,,
,, I'll try that.
,,
,, Ok, I just downloaded Regexp-Common-2.120. Now I have a folder
,, with a bunch of stuff in it. This may sound like an incredibly
,, stupid question, but what do I do with it? I've never actually
,, used a CPAN module before. Any hints a CPAN newbie should be
,, aware of?
One could start with reading a file called README.
Abigail
--
print v74.117.115.116.32.97.110.111.116.104.101.114.
v32.80.101.114.108.32.72.97.99.107.101.114.10;
|
| Similar Threads | Posted | | "our" from XS and some other questions | April 21, 2006, 4:54 am |
| questions about RE! | February 9, 2007, 4:21 pm |
| Where to ask mysql questions? | July 29, 2005, 7:55 pm |
| Hash questions | August 4, 2005, 7:02 am |
| some perl questions | October 24, 2005, 8:18 am |
| 2 basics questions: 1)'a' < 'b' 2)Run, but is it ok? | January 18, 2006, 9:13 am |
| concurrency with DBI questions | February 28, 2006, 12:18 pm |
| Other XS progamming questions | April 14, 2006, 10:33 am |
| Questions about Inline::C | September 28, 2006, 3:58 am |
| Style questions | January 25, 2007, 5:48 pm |
|