LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default RegExp

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RegExp information Alain R. Excel Programming 1 February 18th 08 02:56 PM
RegExp - String in VBA MSK Excel Programming 0 July 24th 07 02:50 PM
Declare RegExp from Vbscript.dll Bob Phillips Excel Programming 0 January 16th 07 07:45 PM
How do you look for two distinct patterns (RegExp) ExcelMonkey Excel Programming 1 August 7th 05 11:29 PM
Regexp needed in Excel 2000 Mr. Me Excel Discussion (Misc queries) 14 August 2nd 05 08:01 PM


All times are GMT +1. The time now is 05:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"