RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 5
Title Test Details Disallow certain characters
Expression
^[^'<>?%!\s]{1,20}$
Description
Disallow ' or < or > or ? or % or ! or space in a string. Minimum character is 1 and maximum is 20 in a string.
Matches
abcd123 | --+abc
Non-Matches
abc'123 | abc? | abc abc | <script>
Author Rating: Not yet rated. Bryian Tan
Title Test Details Password with n numbers of digits, upper case character and special character.
Expression
(?=^.{12,25}$)(?=(?:.*?\d){2})(?=.*[a-z])(?=(?:.*?[A-Z]){2})(?=(?:.*?[!@#$%*()_+^&}{:;?.]){2})(?!.*\s)[0-9a-zA-Z!@#$%*()_+^&]*$
Description
User can specify n numbers of digits, upper case character and special character. In this example, we will use two special characters, digits and upper case in the password. Explanation: (?=^.{12,25}$) -- password length range from 12 to 25 (?=(?:.*?[!@#$%*()_+^&}{:;?.]){2}) -- at least 2 special characters (!@#$%*()_+^&}{:;?.}) (?=(?:.*?\d){2}) -- at least 2 digits (?=.*[a-z]) -- characters a-z (?=.{2,}[A-Z]) -- at least 2 upper case characters
Matches
PassW0rd@1*3, pAsSword@#123
Non-Matches
PassW0rd@1*, PassW0rd@1*3', PassW0rd@1 3p
Author Rating: Not yet rated. Bryian Tan
Title Test Details RegularExpression which does not allow SPACE
Expression
(?=^.{1,}$)(?!.*\s)[0-9a-zA-Z!@#$%*()_+^&\[\]]*$
Description
Regular Expression which does not allow SPACE but allows every possible alpha-numeric and special characters.
Matches
abc*()A123 | 12xyz[_]
Non-Matches
no space | abc *0123[]
Author Rating: Not yet rated. Bryian Tan
Title Test Details Regular Expression to validate file path and extension
Expression
^(?:[\w]\:|\\)(\\[a-z_\-\s0-9\.]+)+\.(txt|gif|pdf|doc|docx|xls|xlsx)$
Description
Regular Expression to validate file path and extension.Compatible with JavaScript and ASP.NET
Matches
\\192.168.0.1\folder\file.pdf | \\192.168.0.1\my folder\folder.2\file.gif | c:\my folder\abc abc.docx | c:\my-folder\another_folder\abc.v2.docx
Non-Matches
\\192.168.0.1\folder\fi/le.pdf | \\192.168.0.1\folder\\file.pdf | \\192.168.0.1\my folder\folder.2\.gif | c:\my folder\another_folder\.docx | c:\my folder\\another_folder\abc.docx | c:\my folder\another_folder\ab*c.v2.docx | c:\my?folder\another_folder\abc.v2.docx | file.xls
Author Rating: The rating for this expression. Bryian Tan
   Displaying page 1 of 1 pages; Items 1 to 5

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials