Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: The craziest RegExes you ever created

by Hue-Bond (Priest)
on Jul 02, 2006 at 17:43 UTC ( [id://558869]=note: print w/replies, xml ) Need Help??


in reply to The craziest RegExes you ever created

Mine was implementing negative lookaround assertions with plain grep -E. I did it for detecting cross-posts between certain newsgroups. The precise regex I used was anchored to the beginning of the line:

^([^e]|e([^s]|s([^\.]|\.([^c]|c([^o]|o([^m]|m([^p]|p([^\.]|\.([^o]|o([^s]|s([^\.]|\.([^l]|l([^i]|i([^n]|n([^u]|u[^x])))))))))))))))

I even made some pseudo-algorithm for building more:

^ ([^e]|e ([^s]|s ([^\.]|\. ([^c]|c <blah> ([^n]|n ([^u]|u [^x] )))))))))))))))

But didn't bother to automate it. In fact, I've never used this again.

--
David Serrano

Replies are listed 'Best First'.
Re^2: The craziest RegExes you ever created
by Ieronim (Friar) on Jul 02, 2006 at 20:37 UTC
    can you give an example of string it needed to match against? :)
      can you give an example of string it needed to match against? :)

      Sure, but off topic I think. It was for using in an .slrn-score file (slrn is the news reader I use). I wanted to give -100 points to posts that where sent to some es.comp.os.linux.* group and to other group outside that hierarchy.

      --
      David Serrano

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found