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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
urn:[a-z0-9]{1}[a-z0-9\-]{1,31}:[a-z0-9_,:=@;!'%/#\(\)\+\-\.\$\*\?]+
Description
Matches canonical Uniform Resource Names (URNs) as defined in RFC 2141.
Matches
urn:vrml:umel:/some/dir/file.ext | urn:schemas-microsoft-com:xml-data | URN:foo:a123,456
Non-Matches
urn:11111.345:12 | http://www.example.org/ | urn:a#-12:555
Author Rating: The rating for this expression. Mark Ayers
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: I found the solution
Name: Diego
Date: 7/6/2016 3:38:15 PM
Comment:
Hi, i found a solution to this case: urn:urn:123 ^urn:(?!urn:)[a-z0-9]{1}[a-z0-9\-]{1,31}:[a-z0-9_,:=@;!'%\/#\(\)+\-\.\$\*\?]+$ now this case is not matched


Title: Good, but fail in one case
Name: Diego
Date: 6/2/2016 8:34:36 PM
Comment:
Hi, thanks for your job, I found only one thing to fix, in the NID value the RFC 2141 explain the follow: To avoid confusion with the "urn:" identifier, the NID "urn" is reserved and MUST NOT be used. and for that this urn "urn:urn:123" is invalid. is possible fix that? thanks!


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