Regex to validate an email address
2
This is as close to a perfect URL regular expression as I've come. It's based on RFC 3986.
A few caveats:
It only accepts http/https/ftp URLs by design, but you could change that to accept any valid URI pretty easily.
It doesn't support IP-based URLs or authenticated URLs. This is also by design, but you could change that with a little work.
A few caveats:
It only accepts http/https/ftp URLs by design, but you could change that to accept any valid URI pretty easily.
It doesn't support IP-based URLs or authenticated URLs. This is also by design, but you could change that with a little work.
5
This is a simple function to check if an email is valid or not.
5
Reg exp for finding url and email adresses. i'm using this from any projects of me. they working
2
The following script is a single interface for pre-validating any HTML form. It lets you validate your form data the way you want, while handling the rudimentary tasks itself.
1) Change just one variable to make it work with $_GET or $_POST or $_REQUEST.
2) Name which elements are 'required' all at once in a hidden HTML text input.
3) Easily provide field descriptions in hidden HTML text inputs that you can use to print error statements.
4) Call a single function to print out error statements that you can easily style with CSS.
5) It automatically checks if fields marked 'required' have been filled out.
Most of the pre-validation code is from PHP 5: Unleashed by Sams Publishing. I found it extremely useful for a recent project. Sharing it here, I removed some unnecessary functions, and tried to simplify some points.
All the comments are my own; hopefully I provided more than enough explanation.
1) Change just one variable to make it work with $_GET or $_POST or $_REQUEST.
2) Name which elements are 'required' all at once in a hidden HTML text input.
3) Easily provide field descriptions in hidden HTML text inputs that you can use to print error statements.
4) Call a single function to print out error statements that you can easily style with CSS.
5) It automatically checks if fields marked 'required' have been filled out.
Most of the pre-validation code is from PHP 5: Unleashed by Sams Publishing. I found it extremely useful for a recent project. Sharing it here, I removed some unnecessary functions, and tried to simplify some points.
All the comments are my own; hopefully I provided more than enough explanation.
5
BerndSchiffer
Ein Kilometerfresser mit Groovy Console, Inlinetests, Groovy Beans, der Meta-Objekt-Programmierung, Swing, GStrings, Regulären Ausdrücken und Closures gebaut. Läuft mit Groovy 1.0 in der Groovy Console.
A Mile-Eater build with Groovy Console, inline tests, Groovy Beans, Meta-Object-Programming, Swing, GStrings, regular expressions und closures. Runs with Groovy 1.0 in the Groovy Console.
A Mile-Eater build with Groovy Console, inline tests, Groovy Beans, Meta-Object-Programming, Swing, GStrings, regular expressions und closures. Runs with Groovy 1.0 in the Groovy Console.
10
A simple snippet for using single pass DES encryption. Uses the .NET framework functions. Enjoy!
-11
This is a faily simple function to validate a URL being passed into your scripts. It will allow for http, https, and ftp. The beginning www. of a URL is optional as well. It will also validate if you have an IP address in place of the domain name. I'm sure this can be improved upon as this is my first attempt at regular expressions but it has worked good for me so far. Please comment or improve if your able.
Thanks!
Thanks!
6
Below is a function written in ColdFusion MX that will return an array containing all matches found when running a regex against a particular string. Each array item is a structure with the match, the starting character position, the ending character position, and an array of any
sub-pattern captures.
sub-pattern captures.
5
Simple function to check for a valid email address. Makes sure the @ and a . are in the right place. There is most likely a perl package on CPAN that would be more extensive, but this happens to work for my uses.
-1
Just a simple check to make sure that a person's email address matches their domain.
For example .. in a form you have 2 textboxs .. 1 for their website url, the other for their email address. This checks to see if the domains for the email address and the website url match.
For example .. in a form you have 2 textboxs .. 1 for their website url, the other for their email address. This checks to see if the domains for the email address and the website url match.









