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