[TriLUG] A curious regular expression

Aaron S. Joyner aaron at joyner.ws
Sun Apr 8 16:32:34 EDT 2007


Marty Ferguson wrote:
> Jim is a truly mighty person.  When he showed up at our "We are Linux
> Entrepenuers"
> booth, my dad (a BSD dude) and I were running  back in 1997, Jim was
> wearing a
> "Whirled Peas" custom silkscreened T-shirt.
> (.... get it... "world peace" ... the  [.*\@{,99}]#&% regex hippie)


Forgive me for latching onto a rather curious portion of your message,
but that REGEX is a most unusual one.it's syntactically valid (your
brackets match, your braces contain an actual numerical range
representation, etc), so I have to think you spent a moment constructing
it, but it's very unlikely to match a sensible string?

Potential matches include:
.#&%
*#&%
.@#&%
*@@#&%

or any combination of the leading . and * followed by 0 to 99 @'s, then
followed by the string #&$.  I suppose it could be used to indicate a
Bugs Bunny style expletive of up to 103 chars in length, with increasing
 lengths involving just padding the @'s, possibly found in the middle of
some other text?

A more general and flexible regex might be something like
/[.*#&%]{,99}/, unless in your experience they always start with . or *,
for some reason?  I'd also include ! and $ in the list of potential
character matches commonly found in cartoon expletives.

Or, is there some more subtle intended implication I'm overlooking,
here?  :)
Aaron S. Joyner



More information about the TriLUG mailing list