Regex Samples: Difference between revisions
Line 36: | Line 36: | ||
|- | |- | ||
| [[File:Regex-23-001.png|thumb|center|750px| Email checker ]] Please note the case insensitive option has to be set. <ref>[http://www.regular-expressions.info/email.html Regular Expressions], This example of the email checker is discussed in more details on the webpage of Jan Goyvaerts.</ref> | | [[File:Regex-23-001.png|thumb|center|750px| Email checker ]] Please note the case insensitive option has to be set. <ref>[http://www.regular-expressions.info/email.html Regular Expressions], This example of the email checker is discussed in more details on the webpage of Jan Goyvaerts.</ref> | ||
|- | |||
| style="text-align:left;" | Please note that not all strange entries will work. There seems to exist an email address with the top level domain name museum. | |||
If you want to validate such addresses to than you have to use something like: | |||
<br>'''<nowiki>^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)$</nowiki>''' | |||
<br>If you use a more simple regex there is a trade-off. Look at: | |||
<br>'''<nowiki>^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$</nowiki>''' | |||
<br>Which allows email addresses like '''xx.yy@domain.office''', which is most likely someone who forget the real extension like '''.nl'''. | |||
|} | |} | ||
Revision as of 15:18, 17 February 2015
Regex Samples Figures 1
Always be precise in the way you specify your data. The following question can be multiple interpreted.
Create a regular expression that matches the figures:
- 1 - 49
- 01 - 49
Of course the ^[0-4]?[0-9] is much too simple.
![]() |
![]() |
![]() |
![]() |
Regex Samples Figures 1
Always be precise in the way you specify your data. The following question can be multiple interpreted.
Create a regular expression that matches the figures:
- 25 - 67
![]() |
![]() |
Regex Email Address
Always be precise in the way you specify your data. The following question can be multiple interpreted.
Create an email checker for input validation of an email.
![]() |
Please note that not all strange entries will work. There seems to exist an email address with the top level domain name museum.
If you want to validate such addresses to than you have to use something like:
|
See also
Reference
- ↑ Regular Expressions, This example of the email checker is discussed in more details on the webpage of Jan Goyvaerts.