471,337 Members | 1,180 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Regular Expression Negative Character Set


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:

Any help would be appreciated!

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

Jul 21 '05 #1
0 1139

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

26 posts views Thread by Shannon Jacobs | last post: by
3 posts views Thread by Rob Meade | last post: by
4 posts views Thread by Neri | last post: by
reply views Thread by brian fischer via .NET 247 | last post: by
3 posts views Thread by Zach | last post: by
25 posts views Thread by Mike | last post: by
2 posts views Thread by Tedmond | last post: by
1 post views Thread by AAaron123 | last post: by
reply views Thread by rosydwin | last post: by

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.