News for hackers. Stuff that matters.
Re:Is it a must for every programmer to learn regular expres... by vorg on Thursday August 16, 2012 @04:50AM (#4390483)
There's nothing wrong with regex syntax. But there _is_ something wrong with the formatting of your example: it's not readable. Perhaps you _should_ write (assuming Java-syntax):

  (?x:              #standard token is an uppercase letter, digit, dot, or hyphen
    \b
    [A-Z0-9._%-]+   #1 or more of standard token, underscore, or percent sign
    @               #at-sign
    [A-Z0-9.-]+     #1 or more standard tokens
    \.              #dot
    [A-Z]{2,4}      #2 to 4 uppercase letters
    \b
  )
We can easily optimize for readability with regex syntax.

There are no comments on this comment yet.