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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Text Extension
Expression
^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*))+\.(txt|TXT)$
Description
This RE validates a path/file of type txt (text file) This RE can be used as a filter on certain file types, while insuring the entire string is a fully qualified path and file. The filter value can be changed or added to as you need
Matches
c:\file.txt | c:\folder\sub folder\file.txt | \\network\folder\file.txt
Non-Matches
C: | C:\file.xls | folder.txt
Author Rating: Not yet rated. Michael Ash
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: http://www.kobe7playoff.com/
Name: kobe 7
Date: 5/18/2012 2:09:38 AM
Comment:
http://www.kobe7playoff.com/ http://www.kobe7playoff.com/nike-lebron-9ix-c-24.html http://www.kobe7playoff.com/dwyane-wade-shoes-c-15.html


Title: http://www.myairmax2012shoesoutlet.com/
Name: nike air max mens
Date: 5/17/2012 11:57:48 PM
Comment:
http://www.myairmax2012shoesoutlet.com/ http://www.myairmax2012shoesoutlet.com/nike-air-max-2012-c-1.html http://www.myairmax2012shoesoutlet.com/nike-air-max-2011-c-4.html


Title: http://www.roseshoesoutlet2012.com
Name: Adizero Rose 1.0
Date: 5/17/2012 11:47:04 PM
Comment:
http://www.roseshoesoutlet2012.com http://www.roseshoesoutlet2012.com/adidas-adizero-rose-10-c-2.html http://www.roseshoesoutlet2012.com/adizero-crazy-light-c-3.html


Title: <a href="http://www.baidu.com">baidu</a>
Name: <a href="http://www.google.com">google</a>
Date: 9/25/2011 9:22:17 AM
Comment:
WOW, so many spam comments.


Title: http://www.karendresses.com
Name: Karen Millen
Date: 8/17/2011 5:50:15 AM
Comment:
My dear friends, do you want to be more sexy in people's eyes? Just come in, please! We are international trade that specializes in the <a href="http://www.karendresses.com">Karen Millen Dresses</a>. Karen Millen is your best choice! Our products are authentic quality with original box. <a href="http://www.karendresses.com">Discount Karen Millen </a>will cost you less money. So, please don’t hesitate, just contact us for details ! We will be your reliable business partner! Welcome to our website:==http://www.karendresses.com== Thank you!


Title: Well done
Name: John
Date: 6/27/2011 9:32:17 PM
Comment:
Easy to understand easy to see how to change the extention easy to see what will happen when inplemented love your work.


Title: A little improvement over Mouhcine's version
Name: Razvan
Date: 3/2/2011 7:44:35 AM
Comment:
^(([a-zA-Z]:)|(\\{2}[^\/\\:*?"<>|]+))(\\([^\/\\:*?"<>|]+))*(\\)?$


Title: A little improvement over Mouhcine's version
Name: Razvan
Date: 3/2/2011 7:41:08 AM
Comment:
^(([a-zA-Z]:)|(\\{2}[^\/\\:*?"<>|]+))(\\([^\/\\:*?"<>|]+))*(\\)?$


Title: A little improvement over Mouhcine's version
Name: Razvan
Date: 3/2/2011 7:38:53 AM
Comment:
^(([a-zA-Z]:)|(\\{2}[^\/\\:*?"<>|]+))(\\([^\/\\:*?"<>|]+))*(\\)?$


Title: Folder Path Regular Expression
Name: Mouhcine
Date: 3/11/2010 4:42:43 PM
Comment:
^(([a-zA-Z]:)|(\\{2}[^\/\\:*?"<>|]+))(\\([^\/\\:*?"<>|]*))*(\\)?$


Title: Folder path (local + network)
Name: Mahender
Date: 7/23/2008 3:19:55 AM
Comment:
^(((\\\\([^\\/:\*\?"\|<>\. ]+))|([a-zA-Z]:\\))(([^\\/:\*\?"\|<>\. ]*)([\\]*))*)$ c# @"^(((\\\\([^\\/:\*\?""\|<>\. ]+))|([a-zA-Z]:\\))(([^\\/:\*\?""\|<>\. ]*)([\\]*))*)$"


Title: Re: Capture specific name
Name: Michael Ash
Date: 11/11/2004 1:19:54 PM
Comment:
^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*))+\\(\d{22}\.moc)$ As noted before http://www.regexlib.com/REDetails.aspx?regexp_id=800 is a better directory regex


Title: Capture specific name
Name: Junior
Date: 11/10/2004 12:46:32 PM
Comment:
I modifiyed the expression, because iam trying to validate the path C:\Documents and Settings\Junior\house\9993000000003310100478.moc But i need to validate the name of the archive have 22 integer and moc extension. But i just can validate 21 postions. Can you help me? ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*))+([0-9]{21}.moc)$


Title: Re: special chars are not accounted for
Name: Michael Ash
Date: 10/20/2004 1:29:02 PM
Comment:
Use http://www.regexlib.com/REDetails.aspx?regexp_id=800 instead


Title: special chars are not accounted for
Name: Vladimir
Date: 10/18/2004 4:36:16 PM
Comment:
the path can contain special char like "&" in them. There is a set of illegal chars, though ( \/:?"<>| ). This accounts for special chars but I cannot get the exlusion for the illegals to work, though, ^(([a-zA-Z]:)|(\\{2}\w+))(\\((\w|\W)[(\w|\W .]*(\w|\W)))*(\\)$


Title: Folder Path Regular Expression
Name: Leny Paul
Date: 9/30/2004 12:56:46 AM
Comment:
I have modified your Regular Expression, with this one for periods in folder names ( Periods in Directories Invalidate) ^(([a-zA-Z]:)|(\\{2}\w+))(\\(\w[\w .]*\w))*(\\)$


Title: Periods in Directories Invalidate
Name: Geoff
Date: 7/26/2004 10:32:02 PM
Comment:
Thanks a lot! I appreciate it.


Title: Re: Periods in Directories Invalidate
Name: Michael Ash
Date: 7/26/2004 1:57:50 AM
Comment:
Use http://www.regexlib.com/REDetails.aspx?regexp_id=800 instead


Title: Periods in Directories Invalidate
Name: geoff
Date: 7/22/2004 6:17:07 PM
Comment:
This works: c:\Holidays\1225\christmas.txt this doesnt: c:\Holidays\12.25\christmas.txt Windows allows periods in Directory names. How can this be added?


Title: Folder Path Regular Expression
Name: Ahmed
Date: 7/1/2004 2:26:24 AM
Comment:
Check this One As well I want that these strings must be allowed c:\, c:\Program Files\, \\ahmed\,\\ahmed\Program files\,C:\program files\C booksand I have modified your Regular Expression, with this one ^(([a-zA-Z]:)|(\\{2}\w+))(\\(\w[\w ]*\w))*(\\)$


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