[Omaha.pm] A regex "best fit" finder?

Dan Linder dan at linder.org
Thu Sep 29 13:53:02 PDT 2011


I have a list of server names that I want to create a regex match against.
 It could be done by hand, but the list changes (adds, removes) on a weekly
basis.

Does anyone know of a program that can take a list of matches and create a
regular expression that will match them?

Example:
OMAWWW001
OMAWWW002
OMADNS001
ORDWWW001
ORDWWW002
ORDWWW003
ORDDNS001
ORDDNS002

I guess the "shortest" match would be /O.......[123]/ but it's kinda
'loose'.

I *think* what I'd like is something like this:
/O[MR][AD][WD][WN][WS]00[123]/
(But a smarter regex tool might find something tighter...)

What I *don't* want is: /OMAWWW001|OMAWWW002|...|ORDDNS002/
I don't have enough space in my tool for a 10K long string! :)

Any thoughts?

Thanks,
DanL

-- 
***************** ************* *********** ******* ***** *** **
"Quis custodiet ipsos custodes?"
    (Who can watch the watchmen?)
    -- from the Satires of Juvenal
"I do not fear computers, I fear the lack of them."
    -- Isaac Asimov (Author)
** *** ***** ******* *********** ************* *****************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/omaha-pm/attachments/20110929/d57cec4e/attachment.html>


More information about the Omaha-pm mailing list