- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Absolute Path
An overly simple UNIX based path regex. The path must begin with a forward slash. The path segments may not lead or end with an underscore or dash which is a good thing. They also can not be doubled (__ or --). Another good thing. I've omitted all the punctuation that RFC allows until further notice.
/users/web/my site/web/cgi-bin | users/web/mysite/web/cgi-bin/
Author Rating: The rating for this expression. tedcambron
Your Rating
Bad Good

Enter New 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: A little better
Name: Ted Cambron
Date: 2/8/2008 9:36:27 PM
I fixed it so the path segments can not begin or end with an underscore or dash nor can they be doubled (__) (--). I prefer not to add any more symbols unless someone can suggest so that understands the purpose of this regex.

Title: Hi Randal
Name: Ted Cambron
Date: 2/6/2008 10:47:54 PM
I just read RFC2396, and I found it somewhat helpful but still a little confusing for me. What I need here is an "abs_path" only thingy. I guess I could add the "marks" to include all the unreserved characters but I really want to leave out :, @, &, =, +, $, & "," for this purpose. The thing I don't understand is the difference between "param" and "pchar" in a segment. Please advise. Master. Can I email you?

Title: Why are you ignoring the standard?
Name: Randal L. Schwartz
Date: 2/3/2008 6:27:01 PM
Have you never seen ? There are far more characters permitted in a URI than you list. Get a clue, sir.

Copyright © 2001-2015, | ASP.NET Tutorials