473,387 Members | 1,569 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.

Regular Expression Negative Character Set

Hello,

I am trying to use a regular expression in Visual Basic Script tomatch some filenames within a folder. However, I am having someissues with the negative range character. I cannot seem to finda way to return all results that do NOT include the "+"character and end with a specific extension. The issue seems tobe with the "[^\+].*" portion of the statement, but I am notsure how to just return palmpack.par2...

filename to match: file_name.par2
filename NOT to match: file_name.vol0_1.par2,file_name.vol100_55.par2, ....

Const Extension = "\.par$|.*[^\+].*\.par2$"

Function FindText(patrn, strng)
'Determine if the pattern exists in a string
Dim regEx ' Create variable.
Set regEx = New RegExp ' Create regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case sensitivity.
regEx.Global = True ' Set global applicability.
FindText = regEx.Test(strng) ' Execute the search test.
End Function

files in the directory:
--------------------
palmpack.par2
palmpack.vol0+1.PAR2
palmpack.vol03+1.PAR2
palmpack.vol04+2.PAR2
palmpack.vol17+04.PAR2
RETURNS:
---------
palmpack.par2
palmpack.vol17+04.PAR2

Any help would be appreciated!

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>OaiEVi3JIUu2y6kfaHUuQg==</Id>
Jul 21 '05 #1
0 1227

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

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
26
by: Shannon Jacobs | last post by:
Sorry to ask what is surely a trivial question. Also sorry that I don't have my current code version on hand, but... Anyway, must be some problem with trying to do the negative. It seems like I get...
3
by: Rob Meade | last post by:
Hi all, I'm going down the road of learing the pattern matching in regular expressions, and I'm trying to convert the characters into English in my head so I can see whats happening... For...
4
by: Neri | last post by:
Some document processing program I write has to deal with documents that have headers and footers that are unnecessary for the main processing part. Therefore, I'm using a regular expression to go...
0
by: brian fischer via .NET 247 | last post by:
Hello, I am trying to use a regular expression in Visual Basic Script tomatch some filenames within a folder. However, I am having someissues with the negative range character. I cannot seem to...
3
by: Zach | last post by:
Hello, Please forgive if this is not the most appropriate newsgroup for this question. Unfortunately I didn't find a newsgroup specific to regular expressions. I have the following regular...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
2
by: Tedmond | last post by:
Dear all, I want to read a file data block by block using regular expression. The file contents is like MWH ........ ................. ..................... MWH ....................
1
by: AAaron123 | last post by:
I found this on the Internet and tried a few of them and they worked in VS2008. Actually it was in a different form but I converted to make a smaller file. The data is the same as the original. ...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.