Ive been doing this forever; I see these regex problems from time to time but never look into them; why? - no interest; but maybe theyd be useful to me if I saw them used in a way that Im doing in another way that takes more work. What exactly are they and what are they good for; the syntax looks extremely convoluted - too convoluted to be in these high level languages we work in at least. Can someone show me an example of where it is good to use vice using there own procedure?
As an example I pulled off this from one of the websites mentioned in the sticky:
^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]
?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$
is suppose to:
does not allow IP for domain name : hello@154.145.68.12
does not allow litteral addresses "hello, how are you?"@world.com
allows numeric domain names
after the last "." minimum 2 letters
I dont see "hello" anywheere in that crazy string up there, and if
I was trying to just filter out "hello" and qoutations Id have:
if(var.IndexOf("hello")!=0 || var.IndexOf("\"")!=0)
SomeError();
Why am I going to spend 20 minutes trying to filter out what the heck all
that syntax is getting to?!!! Somebody reading someone elses
code could easily figure out what I typed.
As an example I pulled off this from one of the websites mentioned in the sticky:
^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]
?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$
is suppose to:
does not allow IP for domain name : hello@154.145.68.12
does not allow litteral addresses "hello, how are you?"@world.com
allows numeric domain names
after the last "." minimum 2 letters
I dont see "hello" anywheere in that crazy string up there, and if
I was trying to just filter out "hello" and qoutations Id have:
if(var.IndexOf("hello")!=0 || var.IndexOf("\"")!=0)
SomeError();
Why am I going to spend 20 minutes trying to filter out what the heck all
that syntax is getting to?!!! Somebody reading someone elses
code could easily figure out what I typed.
Last edited by a moderator: