Reputation: 1973
I write a RegExp for validate a file URL
file:/{2,3}[a-zA-Z0-9]*\\|?/.*
for URL like
file:/D:/workspace/project/build/libs/myjar-1.0.jar
But doesnt work, am looking for a pattern that matches only URL like this,no other.
Pattern Will return false URLs like
file:/workspace/project/build/libs/myjar-1.0.jar
and
file:/D:/workspace/project/build/libs/myjar-1.0
are will not match
please help
Upvotes: 0
Views: 93
Reputation: 72875
Complete question rewrite
Given the OP's updated criteria, the regex you're looking for is file\:\/\w\:\/[^\s]*\.jar
; ensure you enabled g
(global) and i
(case-insensitive) modifiers.
See a working example on Regex101
Upvotes: 1
Reputation: 23361
If there is no context or rule your regex should be:
/file\:.*/i
See it here: http://regex101.com/r/yY5xG6
Upvotes: 0