On Tue, Jul 20, 2004 at 05:28:25PM -0400, Chris Santerre wrote:
> The code we are using to make the rule is like one step. I wish I could make
> it 2-4 steps. What do I mean? It could have written these more streamlined:
> 
> /\bhomeg(?:ain\.com|ain\.biz|ain\.net|un\.com)\b/i
> 
> It should have SUB sections, but our parser is only one level deep :(
> 
> /\bhomel(?:oanace\.com|andunited\.com|anddefensejournal\.com|anddefenseradio
> \.com|andsecurityresearch\.com|ead\.net|essprelates\.com|essteens\.com)\b/i
> 
> Could be written
> 
> /\bhomel(?:oanace\.com|and(?:united|defensejournal|defenseradio|securityrese
> arch)\.com|e(?:ad\.net|(?:ss(prelates|teens)))\.com)\b/i
> 
> I bet the file could be half the size it is now. But I don't have the script
> experience to do this. So anyone who can improve the logic would be a great
> help. 

I think that regexp-opt function of GNU Emacs does exactly
that. Although emacs regexp syntax is different it should be easy to
convert resulting regexp to format that Perl understands.
Eugene

-- 
Email: [EMAIL PROTECTED]

Reply via email to