Very interesting approach of assembling regexes; although this would not generate the results required when inputting real life data like:
my @urls = qw(
http://www.youtube.com/user/jantje
http://www.youtube.com/user/pieter
http://www.youtube.com/user/frida
http://youtube.com/user/channel
http://youtube.com/channel/doesntexist
http://youtube.com/user/blah
http://www.youtube.com/user/bianca_sterlings
http://www.youtube.com/user/blango );
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 |