Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




VBScript Regular Expressions 5.5


hi,

i needed the link to download " VBScript Regular Expressions 5.5 ". where from can i get it, an exact link would be much appreciated. thanks.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
VBScript Regular Expressions 5.5
hello, any suggest if hope see
a,e,i,o,u => A,E,I,O,U

which step ?

example:
text1 ...Command1....text2
unhappy -> UnhAppy
usa -> UsA
telphone -> tElphOnE
...

if use (VBScript Regular Expressions 5.5) is better than "if..then..else" ?

any suggest ?

[VBScript In VBA] Regular Expressions
Hello,

This is a general question, because I've just started with regular expressions and I have by no means a deep understanding of their full potential. So here it goes: Given x words (or characters, for that matter) in String A, I want to find out if at least n elements of String A are present in String B. It's not like data validation, it's rather checking if A is a substring of B, but not necessarily as a whole.

This is a sample string. --> pattern based on this string to find 3 or more words in a different string, like:

A sample string. --> match
This is not a sample string. --> match
These are sample strings. --> match

Is it possible to achieve that with the regular expression object included in VBScript?

Cheers,

Guillermo

Microsoft VBScript Regular Expressions 5.6

I am trying to use

Microsoft VBScript Regular Expressions 5.6.

Have downloaded it and installed, under windows2000.

How do i get a reference to this in my vb project.

I probably have to add the dll to the references., the problem i have is, i do not know the name of the .dll

Appreciate any help .

Regards Kennedymr2

Installer Tripping Over VBScript Regular Expressions...
I'm using Visual Studio Installer 1.1 to build the install file for a VB app I'm writing. The app uses RegEx, requiring a VBScript Regular Expressions 5.5 reference.

I added the VBScript Regular Expressions 5.5 reference, which I notice says "vbscript.dll3". VSI sees the reference as "3", and trips over it. I've added VBScript.dll to the installer file for placement in WindowsSystem32, which allows VSI to continue building, and works like a charm on MY PC.

My Boss uses a machine with IE 5.0, and when he tries to install, he gets an error stating that VBScript.dll cannot be changed/accessed... oh who knows... (sometimes it's like he just makes this stuff up anyway ) it's an error. He can still continue the installation, and I know he has (an older) vbscript.dll.

When he attempts to run the application, it errors: "Run-time Error 430 Class does not support automation".

I assume ( a-- you me) that this is the result of of his having an older (ie 5.0 version of) vbscript.dll, which I don't think includes support for RegEx.

I would rather not tell my gazillions of future clients that they can only use the app if they have IE 5.5+ or IE 6+.

Anyone else encounter this?

Need Reference For "Microsoft VbScript Regular Expressions" RESOLVED
anyone have a link where i can find help for the above library?

thnks

http://msdn.microsoft.com/library/de...ting051099.asp

Regular Expressions
Dear All,
How to use Regular Expression, to find a word "egin".

A Little Help With Regular Expressions.
Hello.

I'm building an instant messenger application.

The messages come in HTML format. I needed to display this using a RichTextbox, which put me on this long journey. I've been working very hard and I'm proud to say I'm getting very close to being able to parse the HTML.

I need to use some simple regular expression to replace any " with ', and I need to check for attributes in the HTML that have no " or ' and add a '. For instance, say I have:


Quote:




<HTML><BODY BGCOLOR="#FFFFFF"><FONT SIZE=2 COLOR="#000000">Hello, I am Inkybro.</FONT></BODY></HTML>




I need this to be replaced with:


Quote:




<HTML><BODY BGCOLOR='#FFFFFF'><FONT SIZE='2' COLOR='#000000'>Hello, I am Inkybro.</FONT></BODY></HTML>




I know how to use the RegExp object pretty well. I at least have a grasp of it. I really just need the correct regular expression, but a quick example would be GREATLY appreciated.

Thanks in advance.

Regular Expressions.
I'm not to used to using regular expressions was hoping someone can help me with this or if it's possible.

I have a text file which contains sets of data. The number of sets and the text that marks the start of each set varies between files.
Using regular expressions I can find the text that marks the start of each data set and the number of data sets.

What I don't know how to do is return all the text that is found between 2 items in the MatchCollection. Is there a regular expression function which tells you the position where the text was found.

Thanks for any help.

Using Regular Expressions In VB5/6
how can i use regular expressions in VB5/6

Regular Expressions Need Help!
Note: This is NOT VB.net, it is simply Visual Basic 6.0

I have a reference for RegExp set - Microsoft VBScript Regular Expressions 1.0

The program I am creating will search HTML source code for the last instance of "day=???". The ??? represent either a one, two, or three digit number. What I would like to do is find the last instance and assign the one/two/three digit number to an integer.

I am not even sure how to begin - it seems like every tutorial Dims differently, some Dim objects, some don't, etc. I am really lost. Any help would be appreciated. Thank you.

GD Regular Expressions!!!! Need Help
Code:
'cut-n-paste for you guys (have to ref. the reg exp via the vbscript dll)
dim rexp as new regexp
regex.pattern = <a.+?href=['""].+?page=matchup.+?[^'"">]+?[^>]*?>
dim match, matches
dim mystring as string
mystring="<font face=arial size=-2><a href=""/nba/show?page=matchup&lid=9962&week=8&mid1=11&mid2=10"">match<br>" & _
"up</a></font></td></tr><tr valign=middle bgcolor=eeeeee><td width=""98%""><font face=arial size=-1>" & _
"<nobr><a href=""/nba/show?page=roster&lid=9962&mid=1"">BigTimers</a></nobr><br>" & _
"<nobr><a href=""/nba/show?page=roster&lid=9962&mid=9"">Rock City Ballers</a></nobr>" & _
"</font></td><td align=right width=""1%""><font face=arial size=-1>2<br>" & _
"6</font></td><td width=""1%"" align=center valign=middle><font face=arial size=-2>" & _
<a href=""/nba/show?page=matchup&lid=9962&week=8&mid1=1&mid2=9"">match<br>" & _
"up</a></font></td></tr><tr valign=middle bgcolor=ffffff><td width=""98%""><font face=arial size=-1>" & _
"<nobr><a href=""/nba/show?page=roster&lid=9962&mid=2"">DoOrDie</a></nobr><br>" & _
"<nobr><a href=""/nba/show?page=roster&lid=9962&mid=8"">Alphas</a></nobr></font></td>" & _
"<td align=right width=""1%""><font face=arial size=-1>6<br>3</font></td><td width=""1%"" align=center valign=middle><font face=arial size=-2>" & _
"<a href=""/nba/show?page=matchup&lid=9962&week=8&mid1=2&mid2=8"">match<br>" & _
"up</a></font></td></tr><tr valign=middle bgcolor=eeeeee><td width=""98%""><font face=arial size=-1><nobr>" & _
"<a href=""/nba/show?page=roster&lid=9962&mid=3"">Doctor Funk</a></nobr><br>" & _
"<nobr><a href=""/nba/show?page=roster&lid=9962&mid=7"">Bronx Ballas</a></nobr></font></td>" & _
"<td align=right width=""1%""><font face=arial size=-1>5<br>4</font></td>" & _
"<td width=""1%"" align=center valign=middle><font face=arial size=-2><a href=""/nba/show?page=matchup&lid=9962&week=8&mid1=3&mid2=7"">match<br>" & _
"up</a></font></td></tr><tr valign=middle bgcolor=ffffff><td width=""98%""><font face=arial size=-1>" & _
"<nobr><a href=""/nba/show?page=roster&lid=9962&mid=4"">Fighting Coatimundis</a></nobr><br>" & _
"<nobr><a href=""/nba/show?page=roster&lid=9962&mid=6"">SMASHMOUTH</a></nobr></font></td>" & _
"<td align=right width=""1%""><font face=arial size=-1>3<br>6</font></td>" & _
"<td width=""1%"" align=center valign=middle><font face=arial size=-2>" & _
"<a href=""/nba/show?page=matchup&lid=9962&week=8&mid1=4&mid2=6"">match<br>" & _
"up</a></font></td></tr>" & _
"<tr valign=middle bgcolor=eeeeee><td width=""98%""><font face=arial size=-1>" & _
"<nobr><a href=""/nba/show?page=roster&lid=9962&mid=5"">ColdKickinIt</a></nobr><br>" & _
"<nobr><a href=""/nba/show?page=roster&lid=9962&mid=12"">GrumpyOldMen</a></nobr></font></td>" & _
"<td align=right width=""1%""><font face=arial size=-1>5<br>" & _
"3</font></td><td width=""1%"" align=center valign=middle><font face=arial size=-2>" & _
"<a href=""/nba/show?page=matchup&lid=9962&week=8&mid1=5&mid2=12"">match<br>" & _
"up</a></font></td></tr>"
set matches=rexp.execute(mystring)
for each match in matches
msgbox match.value
next
all I want to return is the:
<a ......page=matchup.....>
nothing more. There should be six matches when it's done right
And i'm lost. I'm close, but I can't seem to get it.
FWIW, you can leave off the exclusions (?!) because they're working right at least......<edit dangit----had to take them out b/c they were being parsed----so ignore that statement/>
Here's a snip of what I'm trying to parse---the entire text is a scraped web page---------so anyway....tia for helping.

I'm cross eyed now.
the string above is one long line-----and that's so you can cut-n-paste it directly into the ide
below is a more readable version

Code:
<font face=arial size=-2>
<a href="/nba/show?page=matchup&lid=9962&week=8&mid1=11&mid2=10">match<br>up</a>
</font></td></tr>
<tr valign=middle bgcolor=eeeeee>
<td width="98%">
<font face=arial size=-1>
<nobr><a href="/nba/show?page=roster&lid=9962&mid=1">BigTimers</a></nobr><br>" & _
"<nobr><a href="/nba/show?page=roster&lid=9962&mid=9">Rock City Ballers</a>
</nobr>
</font>
</td>
<td align=right width="1%">
<font face=arial size=-1>
2<br>
6</font>
</td>
<td width="1%" align=center valign=middle>
<font face=arial size=-2>
<a href="/nba/show?page=matchup&lid=9962&week=8&mid1=1&mid2=9">
match<br>
up</a>
</font>
</td>
</tr>
<tr valign=middle bgcolor=ffffff>
<td width="98%">
<font face=arial size=-1>
<nobr>
<a href="/nba/show?page=roster&lid=9962&mid=2">
DoOrDie</a>
</nobr>
<br>
<nobr>
<a href="/nba/show?page=roster&lid=9962&mid=8">
Alphas</a>
</nobr>
</font>
</td>
<td align=right width="1%">
<font face=arial size=-1>
6<br>
3</font>
</td>
<td width="1%" align=center valign=middle>
<font face=arial size=-2>
<a href="/nba/show?page=matchup&lid=9962&week=8&mid1=2&mid2=8">
match<br>
up</a>
</font>
</td>
</tr>
<tr valign=middle bgcolor=eeeeee>
<td width="98%">
<font face=arial size=-1>
<nobr>
<a href="/nba/show?page=roster&lid=9962&mid=3">
Doctor Funk</a>
</nobr>
<br>
<nobr>
<a href="/nba/show?page=roster&lid=9962&mid=7">
Bronx Ballas</a>
</nobr>
</font>
</td>
<td align=right width="1%">
<font face=arial size=-1>
5<br>
4</font>
</td>
<td width="1%" align=center valign=middle>
<font face=arial size=-2>
<a href="/nba/show?page=matchup&lid=9962&week=8&mid1=3&mid2=7">
match<br>
up</a>
</font>
</td>
</tr>
<tr valign=middle bgcolor=ffffff>
<td width="98%">
<font face=arial size=-1>
<nobr>
<a href="/nba/show?page=roster&lid=9962&mid=4">
Fighting Coatimundis</a>
</nobr>
<br>
<nobr>
<a href="/nba/show?page=roster&lid=9962&mid=6">
SMASHMOUTH</a>
</nobr>
</font>
</td>
<td align=right width="1%">
<font face=arial size=-1>
3<br>
6</font>
</td>
<td width="1%" align=center valign=middle>
<font face=arial size=-2>
<a href="/nba/show?page=matchup&lid=9962&week=8&mid1=4&mid2=6">
match<br>
up</a>
</font>
</td>
</tr>
<tr valign=middle bgcolor=eeeeee>
<td width="98%">
<font face=arial size=-1>
<nobr>
<a href="/nba/show?page=roster&lid=9962&mid=5">
ColdKickinIt</a>
</nobr>
<br>
<nobr>
<a href="/nba/show?page=roster&lid=9962&mid=12">
GrumpyOldMen</a>
</nobr>
</font>
</td>
<td align=right width="1%">
<font face=arial size=-1>
5<br>
3</font>
</td>
<td width="1%" align=center valign=middle>
<font face=arial size=-2>
<a href="/nba/show?page=matchup&lid=9962&week=8&mid1=5&mid2=12">
match<br>
up</a>
</font>
</td>
</tr>

Regular Expressions, How To...?
Hello folks, I have the following problem:
if I have the string: ",data1,data2,data3,data4, data5," and using RegExp of VBScript, I would like to get:
- data1
- data2
- data3
- data4
- data5
but when I iterate over the MathCollection with the pattern: ",[^,],"
the results are:
data1, data3 and data5
it seems that the procedure ignore some cases,
do you know what I have to do to get the five datas?

thanks in advance, Angel.

Regular Expressions
Dear All,
How to use Regular Expression, to find a word "egin".

Help With Regular Expressions
Hi everyone,

got in a bit of a mess trying to use regex. I had a look in the forums and picked up bits that I might need but could not quite figure out how it works.

I am trying to split a line of delimited data using the split function which works fine until for example I come accros something like this

"Hello","World","Hello,World" which when using "," as the delimiter gives me 4 elements in my array rather than 3. I know I could use (",") this as my delimiter but would this be the most efficient way of doing this?

Oh, I nearly forgot AND I get an error (run-time error 5017) when I try and do my replace.

Thanks your your help

Gogi


VB Code:
Private Sub Command1_Click() Dim mainFile As IntegerDim text As StringDm regEx As New RegExp 'Regular Expression objectDm str1 As StringDim strReplace As StringDim Delimiter As String mainFile = FreeFile Open "C: est data est.txt" For Binary As mainFile Seek mainFile, 1 Line Input #mainFile, text Delimiter = "," regEx.Pattern = "(?<="")[^" & Delimiter & "].*?[^" & Delimiter & "](?="")" str1 = text strReplace = "~" Debug.Print str1 str1 = regEx.Replace(str1, strReplace) Debug.Print str1 end sub

Regular Expressions
I have to check a string each time I pull a line from my text file against the following criteria. Anyone good with 'Regular Expressions' that can help build the correct syntax?

Min 2 chrs, Max 32 chrs
Must contain only letters, numbers, underscores and a single dot(.)
Must start with a letter
Must not end with a _
Must not contain more then one consecutive _

Thanks.

Regular Expressions
I heard something about regular expressions and vb6 and i wonder what the hell it could be.I found that you should add regxp.dll or somehow reference into vb etc..
Well where exactly should i look for documentation about this at msdn ?]
If you could tell me some things how they work and

Regular Expressions
Hi,

I wish to create a regular expression, that searches for a word spelt in upper case or lowers case, or a mixture of the two. Then any amount of characters, or spaces, followed by another word. This is what i have come up with so far, but it isnt working.

[Hh][Ee][Ll][Ll][Oo](^[Aa][Cc][Cc][Oo][Uu][Nn][tt])+

Any help would be great

Regular Expressions...I Think
ok, im working on a mud(multi-user dungeon) client, i have the basic stuff down, connection multiple windows, you can send commands to all open muds, change the colors of the RTF text sent from the server or what have you, right now my next goal are triggers.

for example the server sends back something like this:
(Pendragon) (231/231hp) (220/220e) (106/106m) (540tnl)

i want to be able to match a pattern in that, something like (540tnl), the amount of expierence till next level, i want to be able to pull it apart and get the number 540 out of it(it will change) and do some stuff with it, like

if that_number < 150 then
change the color of (540tnl)

i hope that i have been clear enough, and if i have not please let me know and ill try again, thanks dull1554

Regular Expressions?
does VB support anytype of regular expressions like JavaScript and PHP do?
I just had to make a bit of code where I want all letters filtered. With regular exp. I could have done very easily, instead I had to use nasty for loops and IFs.

Regular Expressions
Hello Gang,

Well, for once in my life I'm actually posing a question. It's a little puzzler that has just started teasing me and I sure one of the geniuses on this board will be able to throw a little light on it without my wasting too much hair-pulling-power.

Basically, I have a Regular Expression I'm using with the Regex static classes in .NET (which, incidentally, employs the exact same syntax as Perl REs). My code and the expression are as so:


Code:
strData = System.Text.RegularExpressions.Regex.Replace(strData, _
"[email]([^""]*)[/email]", _
"<a href=""mailto:$1"">$1</a>", _
System.Text.RegularExpressions.RegexOptions.IgnoreCase)


The point, as any Regex king will have spotted, is to replace [email.]karl@karlmoore.com[/email.] vbCode tags with <a href="mailto:karl@karlmoore.com>karl@karlmoore.com</a> tags. Yes, it's part of the code for a potential new VB-Forums that I've been looking at myself.

The problem? If you have more than one [email.]yadda[/email.] tag - or [b] tag or [i] tag or whatever. If you do, this reg/ex will take the very first [email.] tag and the very last [/email.] tag and ignore the stuff inbetween.

That's my problem. I somehow need the regular expression to look for the *next* [/email.] tag and close it, therefore allowing more than one tag of the same type in a string of text.

Sounds weird, sounds complicated, sounds strange, but personally I think I'm just missing a hash or something.

Looking forward to any responses. This has been niggling me.

Going to bed now

- Karlos

Regular Expressions
I still use VB5. Can someone tell me if later versions will let me use REGULAR EXPRESSIONS.

Regular Expressions In VB6 - Is This Possible ?
Regular Expressions in VB6 - is this possible ?

tnx.

Regular Expressions
Does VB6 support regular expressions?

Regular Expressions In VB6
Programming without the aid og regular expressions is like typing with a few fingers missing.
Does anyone know of a good (free) regular expressions module for VB6?

Regular Expressions Again
having a stinker of a time writing an expression. ive managed to bodge it to work but i know it can be better.

CODERE.Pattern = "(Deal|Show|Muck)(Cards|Flop|Turn|River)([sS]*?)<Card value=""([sS]*?)</Action>"

Regular Expressions
As I had hoped for in the past thread222-867395: Search file for pattern I just ran across a program made by the guy that makes "The Regulator" that helps you test regular expressions.  The new program is called Regulazy



I haven't played with it much but thought I'd share.

Regular Expressions Help
Hey there everyone,

just wondering if someone can help me out.

I'm trying to create a RegExp that will match me "I'm a big boy now" (quotes included) out of:
Quote:Jimmy said: "i'm a big boy now"
Can anyone help me accomplishing this pattern ?

I thought:
Code:Dim RegExStr As String
RegExStr = Chr(34) & "*" & Chr(34)
Would do the trick, but it seems that it doesn't

All help is highly appreciated!

Search before you ask - if you don't know where to search, ask before you search

Regular Expressions
Dear All,
How to use Regular Expression, to find a word "egin".

Need Help With Regular Expressions
hi everybody,

i have a string containing something like that: "user:xyz!realname:Kriss!"
now i want to parse the string after occurence of "xyz" in the context of "user".

i've referenced the regexp object from MS and used it in that way:


Dim content as string
content = "user:xyz!realname:Kriss!"

Dim r as new RegExp
Dim Match, Matches
r.Pattern = "user[^!]+)!"
r.IgnoreCase = true
r.Global = true

set Matches = r.Execute(content) ' Execute search.
for Each Match In Matches ' Iterate Matches collection.
Debug.print Match.FirstIndex & ".pos is " & Match.Value & "."
next





This works in the right way to get the info about firstindex and value of matched string, but it is useless for me .. i think therefore i can use the r.test statement ..

my question is now: how can i access the first group of he matched string ??
and which methods has the "Match" object or the Matches-Collection??

could anybody help me plz ??
Are there any links or examples or other material which describe the regexp object and use of it ??

i looked through the msdn but couldn't find detailed informations about match-object or matches-collection :-((

best regards
Kriss

Regular Expressions
Is there a way to not only find a specific expression in a string, but make sure that the regular expression is the ONLY thing in that string

Regular Expressions
I'm looking for a component that will parse regular expressions. I found "regexp" as freeware on the internet. FYI, here's an exerpt from the readme file:

"This is a freeware wrapper for regular expression using C++ and COM.
It is based on the implementation of a regular expression engine written
by the legendary Henry Spencer originally in "C" around 10 years ago."

HOWEVER, it won't parse regular expressions like [0-9]{3} (give me 3 digits). It doesn't like the braces.

Next, I found RegularX (http://www.solutions.nu/RegularX/). The demo works great and I'd love to buy it ($150) but nobody answers the phones (2 numbers -- one is "customer support") and the web link to purchase gives a "page not found" error.

Does anyone know if this company is still in business? Does anyone know how to get a hold of them?

Better yet, does anyone know of an alternate regular expression library that I can use from VB and will handle regular expressions with the braces?

(There were a few posts to the C++ forum not too long ago but I couldn't find the materials that were referenced or if they applied to VB.) Thanks for the help!

Mark
mevans@printrak.com

Regular Expressions In VB
does anyone know a free component, DLL or "something" that I can use in my VB app to get regular expression functionality?
VB's "Like" operator is ridiculous.

Currently I use the Scriptlet control for using JScript's regular expressions, but that is REALLY slow.
I also tried to write my own C++ DLL based on GNU sources, but I couldn't get it to work.

Regular Expressions
given a string such as:
"(one)(two)|three|four|five|"

how can i be able to get the ff strings using regular expressions:
1. |three|
2. |four|
3. |five|

or better yet ...

1. three
2. four
3. five

i can't use the pattern "|.*|" because it just returns the string "|three|four|five|" since it is also enclosed in ||

Using Regular Expressions With HTML
I know more or less nothing about regular expressions, but I need to parse HTML tables (data copied from Excel is HTML on the clipboard) in MS Access and looping through the large strings is not performing well. Using Split() is fast, but also case-sensitive. Can someone help me with a regular expression that will extract all the HTML from a table row, and another that will extract cells from each individual row? I care nothing about the formatting or anything. I just want to import the cell text. (This will not exclusively be used to import text from Excel or I'd use Excel VBA.)

I am aware there is a tutorial on regular expressions, but it didn't give me enough understanding of the expressions to do what I'm trying to do here.

What I do currently is Split() on "<tr" and then split each row on "<td" and parse out the cell. Here is an example of the HTML:


Code:
<col width=96 style='mso-width-source:userset;mso-width-alt:3510;width:72pt'>
<col width=77 style='mso-width-source:userset;mso-width-alt:2816;width:58pt'>
<col width=99 style='mso-width-source:userset;mso-width-alt:3620;width:74pt'>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl24 width=96 style='height:12.75pt;width:72pt'><s>CPHDB-18</s></td>
<td class=xl24 width=77 style='border-left:none;width:58pt'><s>B124R1</s></td>
<td class=xl24 width=99 style='border-left:none;width:74pt'><s>UT</s></td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 class=xl24 style='height:12.75pt;border-top:none'><s>CPHDB-37</s></td>
<td class=xl24 style='border-top:none;border-left:none'><s>B124R1</s></td>
<td class=xl24 style='border-top:none;border-left:none'><s>UT</s></td>
</tr>

Regular Expressions Question
anyone got a tip or two on how to use two different expressions in a loop that goes through a text file?

Basically I want to search for two expressions in one long string, and then concatenate them together. Below is an example of the string I want to pull from.

I have the expressions built, but I don't know how to use them at the same time.
Basically I want to pull the time, ip, and url from it. I don't want the crap inbetween. Is it possible with a better expression maybe?
Instead of using two different ones?

11/11/2005 06:19:42 10.0.0.121 - HTTP "GET http://www.acousticguitarforum.com/f.../misc/smlg.gif HTTP/1.0" 200 2410 2410 526 218 MISS 217.160.250.165 D


Code:
Private Sub ListView1_DblClick()
regexpr1 = "d{2}:d{2}:d{2} d{1,3}.d{1,3}.d{1,3}.d{1,3}"
regexpr2 = "[a-z]{1,}.[a-z]{1,}.[a-z]{1,}"

If chopstick = 1 Then
Form1.Hide
ff = FreeFile()

strfiles = ListView1.SelectedItem
For i = 0 To UBound(strLogarray)
If strLogarray(i) = "" Then Exit For
If FileDateTime("\ppfwavlogs" & strLogarray(i)) = strfiles Then
strfiles = Dir$("\ppfwavlogs" & strLogarray(i))
Open "\ppfwavlogs" & strfiles For Input As ff

Do While Not EOF(ff)
Line Input #ff, strTextfile
Set regxyz = New RegExp
regxyz.Global = True
regxyz.Pattern = regexpr1

Set matches = regxyz.Execute(strTextfile)
For p = 0 To matches.Count - 1
textbox.Rtfbox.SelText = matches.Item(p) & vbCrLf
Next p
Loop
End If
Next i
Heres some code:

Recursive Regular Expressions
I'm having a lot of trouble wrapping my mind around how to solve a problem.
I'm pretty sure the coding is simple, I just can't figure out how to do it.

So, I'm building a regular expression interpreter. Wikipedia
That builds a list of every single possible value that can be derived from a regular expression.

I need to make my program loop through every element in the expression and list all of the possible values then save them to a file.

For instance, if the user uses "[a-z]" as the expression, my program must loop through every letter, abcdefg...xyz and then save them to a file.

that I can do. BUT...

If a user enters "[a-z][a-z]" my program will have to loop through every letter for both expressions, and return aa, ab, ac, ad, ae...zx, zy, zz.

The program needs to recursively loops through an unknown amount of elements in a regular expression, and return the result.

HELP! This hurts my mind!

Regular Expressions Tutorial?
does anyone know a manual for it??
i dont know anything about it...and i have a code that i need to implements into my program,which makes me feel bad,since i dont know exactly how does it work...for e.g:
Private reg As RegExp
Dim textb As String
Private Sub Form_Load()
textb = Inet1.OpenURL("http://132.68.130.12/ashdodw.html")

Set reg = New RegExp
reg.IgnoreCase = True
reg.Global = True
reg.MultiLine = True
Dim fromweb As String

reg.Pattern = "(.*?)(<.*?>)(.*?)"
fromweb = reg.Replace(textb, "$1$3")
fromweb = Replace(fromweb, Chr(10), vbNewLine)
fromweb = Replace(fromweb, "&nbsp;", " ")
fromweb = Replace(fromweb, "&amp;", " ")
Text1.Text = fromweb


End Sub

does anyone have a good tutorialmanual for that???
thanks in advance.

Regular Expressions (Yes, I Have Searched :P)
Hi guys,

After an hour of fiddling with a regular expression I've determined that they're completely above me. I can get it to almost work, but it chokes on one thing.

What I need is for a string to be parsed like so:


Code:
Optional
- letter
- number
- space (" ")
-- (as many as wanted)
Required
- space (" ")
- Left brace ( { )
- (as above optional, letter, number, space)
- Right brace ( } )
- Nothing after that last right brace
I got it to work - except for when I would put a space (" ") between the braces, RegExp.Test would return False

What I was using:


Code:
Pattern = "w* {[w]*}"
String = "b5 fe3b 23rtv {boo}"
That works. It comes up as True. But if I change the String to


Code:
String = "b5 fe3b 23rtv {boo yaa}"
It chokes .

I'm probably missing something really simple here, so any help is appreciated (or entirely better ways of doing the pattern, hint hint )

Cheers


EDIT!: I kind of stuffed that up - what can go at the start should be "anything", and same with what is in the braces. I think that's where my Pattern fails me - it's too specific

Using Replace In Regular Expressions
Hi,

I have been trying to get the replace function in a RegExp to evaluate my regular expression.

It can find the text I am looking for but replaces it with the expression text instead of the match

Example:

I want to swap a space to a pipe in a date-time field from a file from a database: so i do this....

Code:
Private Sub Main()

Dim objRegExpr As RegExp
Dim objMatches As MatchCollection
Dim objMatch As Match
Dim objFileIn As TextStream
Dim objFSO As FileSystemObject
Dim strLine As String

Set objFSO = New FileSystemObject
Set objFileIn = objFSO.OpenTextFile("my file.txt")

Set objRegExpr = New RegExp

Do Until objFileIn.AtEndOfStream
strLine = objFileIn.ReadLine
Debug.Print strLine
Set objRegExpr = New RegExp
objRegExpr.Pattern = "(-dd) (dd:)"
objRegExpr.IgnoreCase = True
objRegExpr.Global = True
strLine = objRegExpr.Replace(strLine, "(-dd)|(dd:)")
Debug.Print strLine
Loop
End Sub

The result from
2001-09-26 05:49:25
is
2001-09(-dd)|(dd:)49:25
and not
2001-09-26|05:49:25
.......what I need.

Can anyone help - I guess it is a problem with the expression, as I havent used them before.

cheers

JAS

Splitting On Regular Expressions
Dont know if Im mixing apples and oranges here but I was wondering if there is some way I could call a split using some regular expression I had defined as a delimiter or if I would have to write my own. I know its not particularly difficult to write one using the locations that the matches give but was wondering if I could take advantage of the already-written split function somehow. And yes, Ive taken a look at the tutorial and some of the links from there but they dont seem to explicitly answer my question.

I suspect that the answer to my question is a resounding no but since regular expressions are defined as strings I figured asking cant hurt.

Thanks

Regular Expressions -vs- Instr, Mid, Etc.
Does anyone know of any sites that compare the use of Regular Expressions versus the Instr and Mid$ functions when extracting data? I know how to use Instr and Mid$ quite well already and I know with Regular Expressions it is possible to extract data as well (and give me more power since I can use more pattern matching), but I am curious what kind of performance hit I may take if I start using Regular Expressions instead. Any help would be appreciated Thanks.

Regular Expressions Help Needed??
Hello,

This is for the regex experts! After wasting about 6 hours of programming time, I decided that i need to try to parse this file using regular expressions. The file is a txt file that I am trying to convert to xls. I have tried to import the text file into excel but there is not a specific delimiter that will format all the data in the correct columns. For instance the title for item 1 is "LENOX Charleston Cut Crystal Old Fashioned"; but as you can see it is on 2 different lines. Does anyone have suggestions about the best way to do this? Are regular expressions the way to go?

Thanks,
Chuck

Sample Data file (the Pattern 1, 2, 3, etc do not appear in the file, those entries just represent each entry based on fee type) :


Code:
--------------------------------------------------------------------------------

Invoice Detail
--------------------------------------------------------------------------------



Date Title Item Fee Type Amount



Pattern 1:
Nov 24 LENOX Charleston Cut 4337292224 Final Value -$0.84
17:24:29 Crystal Old Fashioned Fee

Pattern 2:
Dec 1 Spode CHRISTMAS TREE Pie 3792314416 Store -$0.66
10:44:35 Serving Plate Referral
Credit
3759314416 Final price:
$24.99 (Store)

Pattern 3:
Dec 1 Wedgwood Blue Jasperware 6134034494 Insertion -$0.35
16:40:54 GIFT Christmas Ornament NR Fee


Pattern 4:
Dec 16 Wedgwood Bone China 3769923447 Final Value -$1.45
13:39:36 FLORENTINE Gold Plate Fee - Fixed

Pattern 5:
Dec 1 Title Not Available -- 2290593644 Final Value $0.74
01:30:58 View Item Fee
Final price: $14.00
(Second Chance Offer)

Pattern 6:
Dec 1 Denby China HARLEQUIN 3762681763 Final Value $1.05
04:35:00 Stoneware Open Sugar Bowl Fee - Fixed
Price
darleneuki Final price:
$19.99 (Store)

Pattern 7:
Dec 1 Haviland Limoges AUTUMN 3766597054 Gallery Fee $0.01
04:55:10 LEAF Plate

Pattern 8:
Dec 1 Haviland Limoges AUTUMN 3766597054 Insertion $0.02
04:55:10 LEAF Plate Fee Store
Inventory

Pattern 9:
Dec 1 Minton Bone China HENLEY 3764021700 Final Value $1.31
08:19:16 Plate Fee
Final price: $24.99
(Auction)

Pattern 10:
Dec 1 Franciscan Fine China 3766487228 Item $0.50
08:23:44 MOON GLOW Platinum Plate Subtitle
Fee

Pattern 11:
Dec 1 Minton Bone China HENLEY 3766404264 10-Day $0.20
08:29:54 Plate Listing Fee


Pattern 12:
Dec 29 Oneida Silver MOZART 4300891920 Stores Good $0.00
08:15:39 Stainless Master Butter Until
Knife Cancelled
Fee

Regular Expressions - IP Address
It's been awhile since I used regular expressions and I've since forgotten most of it.

What would be a good way to find an IP address using regular expressions?

It's for a small program to get external IP from different web servers that each have their own formatting. Parsing these would be easy but I'd rather not have to do each one separately and in case the page gets updated...

Thanks.

Regular Expressions And Money
It's been a long while since I've used RegEx.
But I think it might be the best thing for what I'm doing now.

I need to search a text to see if it contains any money values >= $##.##
(#'s could be any numeric value)

Any ideas?

Problems With Regular Expressions
Ok the idea is to change colors in a richtextbox by finding the item you want highlighted by using Regular Expressions. The problem is that It seems not pickup certain characters. Here is the code I'm using:


VB Code:
Dim re As New RegExp, mtch As Match, mtchcol As MatchCollection    re.Global = True    re.IgnoreCase = True    re.Pattern = "="    Set mtchcol = re.Execute(rtb1.Text)    For Each mtch In mtchcol        DoEvents        If mtch <> "" Then            rtb1.SelStart = mtch.FirstIndex            rtb1.SelLength = 1            rtb1.SelColor = Val("&hABABAB&")        End If    Next mtch


Now if I use this text:

Quote:




This=That
This = That






When I use the code pasted above the = sign in this line "This=That" is the only one highlighted.

Anyone have a clue as to why the other = sign is ignored?

Regular Expressions For Html
Hello !
I want to build a regular expressions that will find a html comment
but only if this comment is NOT within quotes .
This means i do not want the comment to be inside an attribute of a tag.

for example it should not find
<img alt="this is a test <!-- this is a test !-->">
because the <!-- !--> is within an attribute.

it should only get this blah <!-- this a test !--> blah
Now how can i do this?


Thanks!

INFO: How To Use Regular Expressions With VB6
We can use the same regular expression object VBScript has access to. Set a reference to "Microsoft VBScript Regular Expressions 5.5" (or 1.0). For those that have never used them, they are based on concepts from the Perl langauge and can blow VB's InStr, Replace, etc functions away when it comes to searching and replacing text.


VB Code:
Dim re As VBScript_RegExp_55.RegExp Set re = New RegExp re.Pattern = "^d{2,3}$" Debug.Print re.Test("99")Debug.Print re.Test("123")Debug.Print re.Test("1234")Debug.Print re.Test("abc") Set re = Nothing

Regular Expressions: Url Pattern
Hi,

I am doing a Program that extracts Email address and
text type file links like html,htm,asp etc....

I am using Vbscript 5.5 Regular Expressions Library

For Emails i found this pattern to be working
"([a-z0-9]|-|_)+@([a-z0-9]|-|_)+" & Chr(46) & "[a-z]{2,3}"

Now I want your help to identify the pattern
which would extract from a html page links such as...

http://www.somesite.com/somepage.html
or
"../somepage.cfm"
or
www.somesite.com/somepage.asp

but not
http://www.somesite.com/image.gif
or
http://www.somesite.com/file.zip

etc...

Please Help..

Regular Expressions Problem
i have a vb.net application that accepts time from a textbox. problem is i need to use a RegularExpressionValidator to validate it. can anyone please give me the regex to use in the regular expression editor for this time format, '9:00' or '10:00'. thanks in advance.

Copyright 2005-08 www.BigResource.com, All rights reserved