Negative Lookbehind Replacement?

M

mail

Hello,

I am trying to use regular expressions to scan a subdirectory structure and
run sfv and parity file checks on the directory. However, I am having an issue
with my current code using regular expressions to find par2 files. Multiple
par2 files are created for an archive in the following format:

test.par2
test.vol000+01.par2
test.vol000+03.par2
test.vol000+07.par2
and so on...

I only want to select the files name "test.par2" using regular expressions.
WSH doesn't seem to have a negative lookbehind function. Is there any regular
expression not using a lookbehind that could get this to work?

Thanks,
Brian
 
W

Will Stranathan

mail said:
test.par2
test.vol000+01.par2
test.vol000+03.par2
test.vol000+07.par2
and so on...

I only want to select the files name "test.par2" using regular expressions.
WSH doesn't seem to have a negative lookbehind function. Is there any regular
expression not using a lookbehind that could get this to work?
You don't need a regex if you're testing specifically for "test.par2".

if ($fn == 'test.par2')

if you MUST use a regex, you don't need a negative lookbehind:

if ($fn =~ /^test\.par2$/)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top