For anyone who is having trouble with regular expressions, I suggest you have a look at this site by Jeff Avallone. It takes a regular expression in the native (cryptic) format and produces a visual display of the same expression. For example,
and the pattern for an email address
One caveat - you will see
which may seem incorrect at first glance, however, the
2...4 times refers not to the number of digits but the number of extra "trips" back through the loop so if you have three digits you require two extra trips back through. I recently suggested to the author that he consider labelling the iterators something like
3...5 occurrences which would be both clear and precise.
In any case, this is a valuable tool for debugging complex expressions.