Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am using Microsoft VBScript RegExp 5.5 within VBA for Excel. http://msdn2.microsoft.com/en-us/lib...ka(VS.85).aspx "Matches pattern and remembers the match. The matched substring can be retrieved from the resulting Matches collection, using Item [0]...[n]. To match parentheses characters ( ), use "\(" or "\)"." - from the docs on the above page. I am wondering if anyone could give me an example of using the Item array to retrieve clustered matches. Like so: regEx.Pattern = ".*(\d{1,2})Y.*" I need to match one or two digits followed by 'Y', but I only need to get the digits. In regEx.Replace() I would use $1 to access the first cluster (the match inside the innermost set of parens), but I am not sure how to do it with regEx.Execute(). Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
RegExp information | Excel Programming | |||
RegExp - String in VBA | Excel Programming | |||
Declare RegExp from Vbscript.dll | Excel Programming | |||
How do you look for two distinct patterns (RegExp) | Excel Programming | |||
Regexp needed in Excel 2000 | Excel Discussion (Misc queries) |