VBScript Basics, Part 72 | RegExp ( Submatches )

preview_player
Показать описание
| VBScript (.vbs) Tutorial
Sometimes in order to match with something your pattern has to be bigger than you wanted, but with submatches you can group which parts of your bigger pattern you actually wanted.

| Code Example
Set reg = New RegExp
reg.Pattern = "your pattern(submatch 0)other stuff(submatch 1)"
reg.Global = True

For Each match In reg.Execute("your string)
msgbox match.Submatches(0)
msgbox match.Submatches(1)
Next
Рекомендации по теме
Комментарии
Автор

I just want to let you know that i am dumbfounded for the amount of dedication you put in this series. 4 whole years?! thats crazy dude, props.

homeboy_
Автор

Jermi I ThankFull To U very First, I Downloaded Your Vbscript 72 Videos.I Am Beging to learn SofterEnginering.Thanks..

englishmaster
Автор

Thanks a lot for this very inspiring VBScript series! Do you have any plans to continue it?

stacmv
Автор

great tutorials, wondering if there is a simple way to capture diacritics letters ?

Petuldus
Автор

Yet another great video. i missed all these years..

Q1: I have a question here str = "1 2 3 1 2 5 6 7 @ # $ @ $ % a s d f w e a s".
Now in this string i need to find the duplicate values and remove them. can you help me with the code.
Q2: how do we validate email ids using regexp.

in the videos u have a bunch of patterns used, its little confusing.

do you have videos on XML objects. if you can provide on that i would be really great and helpful to learn.
i would require example on multiple tag based.

Thanks

manishabro