473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Negative Lookbehind Replacement?

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

Jul 19 '05 #1
1 2216
mail <ma**@mail.com> wrote in message news:<b3******************************@news.terane ws.com>...
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$/)
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Margaret MacDonald | last post by:
I'm trying to write a filter that will ignore text of the form '\_foo\_' while filtering text of the form '_foo_'. In other words, a backslash is meant to protect against the operation of this...
7
by: Matthew Wilson | last post by:
Hi- I just discovered this: >>> -1 // 12 -1 >>> 1 // 12 0 >>>
1
by: Thomas F. O'Connell | last post by:
I've been looking through the negative lookbehind posts and haven't yet found a definitive answer to the question I'm about to ask: Does negative lookbehind have lower precedence than even a...
2
by: brendan | last post by:
Hi ... want to antispam any email address that is written in a page, so long as it is not already contained in a hyperlink ie 'mailto:user@email.com' so am trying to use a negative look behind...
4
by: DSmith1974 | last post by:
Are lookarounds supported in the boost regex lib? In my VS6 project using boost 1.32.0 I can declare a regex as.. <code_snippet> std::wstring wstrFilename = L"01_BAR08"; boost::wregex...
3
by: Jim | last post by:
Hi, I'm trying to prefix the "src" attribute of all "img" elements with a given string, $prefix. Here's what I've got: preg_replace('/\<img(.+?)src="(?<!=http)(.+?)"(.+?)\/>/', '<img $1src="'...
5
by: vbgunz | last post by:
/* * BEGIN EXAMPLES */ var text = 'A Cats Catalog of Cat Catastrophes and Calamities'; /*** * EXAMPLE 1: negative lookahead assertion logic ***/
2
by: Bart Kastermans | last post by:
I have a file in which I am searching for the letter "i" (actually a bit more general than that, arbitrary regular expressions could occur) as long as it does not occur inside an expression that...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.