HALP - REGEX (7)

1 Name: #!/usr/bin/anonymous : 2007-05-22 18:27 ID:eRpYLdKP

I don't really understand regular expressions. This is the one I'm working with:

^[a-zA-Z][\w\.-][a-zA-Z0-9]@[a-zA-Z0-9][\w\.-][a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$

So, please help me break it down.

^[a-zA-Z][\w\.-]*

I know that ^ means start with, and that the * means 0 or more instances. I get that [a-zA-Z] means any letter in the alphabet, but what's the other cluster and what do the two sets of brackets next to each other mean?

2 Name: #!/usr/bin/anonymous : 2007-05-22 18:58 ID:eRpYLdKP

Nevermind, figured it out.

3 Name: #!/usr/bin/anonymous : 2007-05-22 19:10 ID:PTElwget

3GET

4 Name: #!/usr/bin/anonymous : 2007-05-22 19:10 ID:PTElwget

neat, wgot

5 Name: #!/usr/bin/anonymous : 2007-05-23 09:03 ID:Heaven

if that's supposed to match an email address, there's plenty of perfectly valid addresses that won't match it. fyi.

6 Name: #!/usr/bin/anonymous : 2007-05-23 11:40 ID:CqYQDpG3

The futility of matching valid email addresses using regexps is aptly demonstrated by this supposedly correct one:

http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html

7 Name: #!/usr/bin/anonymous : 2007-05-23 19:45 ID:Ui8Zg8Vm

>>6
Hahaha, awesome

This thread has been closed. You cannot post in this thread any longer.