Shawn
asked on
REFindNocase breakdown
anybody want to have fun and help me break this down. I've used it and it works but it's a little beyond my understanding. What's with "museum" for example?
<cfif not REFindNocase("^[_a-z0-9-]+ (\.[_a-z0- 9-]+)*@[a- z0-9-]+(\. [a-z0-9-]+ )*\.(([a-z ]{2,3})|(a ero|coop|i nfo|museum |name))$", FORM.ClientEmailNewPasswor d)>
<cfif not REFindNocase("^[_a-z0-9-]+
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
wow, that clears things up! thanks for taking the time.
Shawn
PS I hate using things when I don't understand them :)
Shawn
PS I hate using things when I don't understand them :)
with the REFindNoCase()...
<cfif not REFindNocase("^[_a-z0-9-]+ (\.[_a-z0- 9-]+)*@[a- z0-9-]+(\. [a-z0-9-]+ )*\.(([a-z ]{2,3})|(a ero|coop|i nfo|museum |name))$", FORM.ClientEmailNewPasswor d)>
basically this is saying <cfif> you don't find (case insensitive) an email which matches the standard format or little different format....
examples:
something@somewhere.com (standard format)
something@somewhere.ca (standard format)
""
or
something@somewhere.aero
something@somewhere.coop
something@somewhere.info
something@somewhere.museum
something@somewhere.name
""
or
something@somewhere.ca.aer o
something@somewhere.tw.com
something@somewhere.com.tw
""
then do what's inside that <cfif> block
<cfif not REFindNocase("^[_a-z0-9-]+
basically this is saying <cfif> you don't find (case insensitive) an email which matches the standard format or little different format....
examples:
something@somewhere.com (standard format)
something@somewhere.ca (standard format)
""
or
something@somewhere.aero
something@somewhere.coop
something@somewhere.info
something@somewhere.museum
something@somewhere.name
""
or
something@somewhere.ca.aer
something@somewhere.tw.com
something@somewhere.com.tw
""
then do what's inside that <cfif> block
Lol, yeah the regex's (especially when they're long) can seem overwhelming or complex, it really helps to copy it and section it out to understand what it's doing each step of the way...
Glad I was able to help clear it up some, good luck!
I know what you mean by inderstanding it too, I started learning regex's that way, had to understand what each thing meant, but before long it gets easier ;o)
Thanks,
~trail
Glad I was able to help clear it up some, good luck!
I know what you mean by inderstanding it too, I started learning regex's that way, had to understand what each thing meant, but before long it gets easier ;o)
Thanks,
~trail
ASKER
thanks again ~trail...much appreciated :-D
1 2 3 4 5 7 8
|__________________6______
|____________________9____
here's a break down of the section I explained numbered on the regex... maybe it'll help to see it sectioned out a little easier....
section 7 and 8 are groups within a group ( ([a-z]{2,3}) | (aero|coop|info|museum|nam
$ means matching that overall group at the end of the line
within that group you have two groups and the overall group is checking for an instance of one or the other
( ([a-z]{2,3}) | (aero|coop|info|museum|nam
example: "ca" or "com"
the period before means checking for ".ca or .com" OR ".aero or .coop or .info or .museum or .name"
let me know if you're still unclear ;o)