Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^2: Reverse regexp a regexp?

by freakingwildchild (Scribe)
on Feb 13, 2010 at 23:09 UTC ( #823069=note: print w/ replies, xml ) Need Help??

in reply to Re: Reverse regexp a regexp?
in thread Reverse regexp a regexp?

Very interesting approach of assembling regexes; although this would not generate the results required when inputting real life data like:

my @urls = qw( );

Which returns:

(?-xism:http:\/\/(?:www\.youtube\.com\/user\/(?:b(?:ianca_sterlings|la +ngo)|jantje|pieter|frida)|youtube\.com\/(?:user\/(?:channel|blah)|cha +nnel\/doesntexist)))

while it should return roughly: ^http:\/\/(?:www\.)youtube\.com\/user\/(.*)$

What this module offers is a rather customized approach of how to create regexes on custom user data, for validation; while I'd like to create a regex on public data to extract the right set of data out of a list of url's. Thanks for letting me know this this one; it's a nice toy to play with :D

Comment on Re^2: Reverse regexp a regexp?
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://823069]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2015-11-25 21:25 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (691 votes), past polls