Regular expression? No Wiener Melange for me please….

This is what most of us will say when we hear the term “Regular expression”. No it’s not a brand new coffee brand, no it isn’t the most common used (and therefore regular) facial expression of the world. No this time I’m talking about some sort of query language used by freaky developers. Recently my program experience is expanding (fast or slow, it IS expanding) and from time to time I literally bounce of a new subject.
Regular expressions is just one of them.

The concept really is fascinating!

These expressions can do almost anything, except make you a delicious Wiener Melange (on the other hand, could your coffee machine make one for you “without” regular expressions? that the question!).
Well jokes aside, I really was fascinated by the concept and couldn’t resist taking a little sneak preview in this crazy world of expressions.
An there come’s the “bounce”…
Really, can anyone tell me what the hack this means???

^((?>[a-zA-Zd!#$%&'*+-/=?^_`{|}~]+x20*|"((?=[x01-x7f]
)[^"]|[x01-x7f])*"x20*)*(?<))?((?!.)(?>.?[a-zA-Zd!
#$%&'*+-/=?^_`{|}~]+)+|"((?=[x01-x7f])[^"]|[x01-x7f])*")
@(((?!-)[a-zA-Zd-]+(?<!-).)+[a-zA-Z]{2,}|[(((?(?<!
[).)(25[0-5]|2[0-4]d|[01]?d?d)){4}|[a-zA-Zd-]*[a-zA-Zd]:
((?=[x01-x7f])[^[]]|[x01-x7f])+)])(?(angle)>)$

Well, if you break it down piece by piece you will eventually see some logic in the above syntax. To safe you all some backtracking time, here is the answer: The above syntax can be used for validating the syntax of an email address. Well, for me this isn’t that logical. From a conceptual point of view these sort of expression can have tremendous power and can be used in very complex situations like pattern recognition. For now I say:

Back to the schoolbooks, we’ve got a lot to learn!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s