[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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)
** *** ***** ******* *********** ************* *****************