R
rand007
Hi,
I am trying to write a simple regular expression that returns a match
for each
string that does not contain specific suffix (e.g. all file names that
do not end with ".txt" extension).
I tried various negative look ahead assertions such as /.+(?!\.txt)/,
/.+(?!\.txt$)/,
/([a-z]|(A-Z)|[0-9])(?!\.txt$)/ and much more, but all of them does not
achieve this specific purpose.
Is there a way to accomplish this task with perl regular expressions?
Thanks,
Ran.
I am trying to write a simple regular expression that returns a match
for each
string that does not contain specific suffix (e.g. all file names that
do not end with ".txt" extension).
I tried various negative look ahead assertions such as /.+(?!\.txt)/,
/.+(?!\.txt$)/,
/([a-z]|(A-Z)|[0-9])(?!\.txt$)/ and much more, but all of them does not
achieve this specific purpose.
Is there a way to accomplish this task with perl regular expressions?
Thanks,
Ran.