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

Re: Most specific pattern

by GrandFather (Saint)
on Jun 30, 2005 at 20:46 UTC ( [id://471470]=note: print w/replies, xml ) Need Help??


in reply to Most specific pattern

If you can calculate the fitness at run time, then try all of the regex's and choose the match which matches using fewest wildcard matched characters. Are matches using a character set a lesser evil than those using .? Probably it's a function of the number of different characters that could have matched at each character location.

The fitness should also be modified by providing some weighting for alternate matches. Would you need to account for backtracking too?


Perl is Huffman encoded by design.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-24 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found