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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Java Get Path
Expression
(jar:)?file:/(([A-Z]:)?/([A-Z0-9\*\()\+\-\&$#@_.!~\[\]/])+)((/[A-Z0-9_()\[\]\-=\+_~]+\.jar!)|([^!])(/com/regexlib/example/))
Description
More advanced regular expression to get the full path to the directory from which your program is running. You may use this to detect the program installation dir whether you are just debugging or having a deployed program. Using the second group combined with the 7th group you'll have a full path to your program. Very useful if you use resources outside of the java package.
Matches
jar:file:/C:/installation/dir/program.jar!/com/regexlib/example/ | file:/install/dir/development/workspace/com/regexlib/example/
Non-Matches
Does not match non-java url | http:/www.regexlib.com/applet.jar!/com/regexlib/example/
Author Rating: The rating for this expression. Alex Ries
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

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