Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Reverse regexp a regexp?

by Anonymous Monk
on Feb 12, 2010 at 20:20 UTC ( [id://822924]=note: print w/replies, xml ) Need Help??


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

Reread what Roboticus said. Your first example could just as easily have been http://www.youtube.com/user/test[1-5] and your second could have been http://(u[sk]|be)\.apple.itunes.com/blabla/blabla/id/(\d*)5(\d+).

How do you make the choices? Once you can answer those questions, you'll be able to make some progress towards what you want.

Replies are listed 'Best First'.
Re^4: Reverse regexp a regexp? (by an algorithm?)
by freakingwildchild (Scribe) on Feb 13, 2010 at 22:56 UTC
    How do you make the choices? Once you can answer those questions, you'll be able to make some progress towards what you want.

    I'd say ... an algorithm of minimum requirements could do the trick here.

    for example:

    1. 10 url's of the same domain of a 95% "similarity" would be matched as "clean url".
    2. 100 url's of the same domain would give more weight
    3. The string detected has to be atleast 4 characters difference before it adds weight/validity
    4. Any others could be selected manually or kept in a cache till they offer a difference
    Some url's will be easier than some others (especially script url's); but most sites got a general structure, to be SEO friendly towards search engines; which would make most URL's a heaven to work with...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-19 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found