LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default RegEx Replacement patterns

"CodeSponge" wrote...
....
For some reason when you are referring to a submatch in the replacment
pattern for a VB regular expression instead of using the \1 format you
have to use the $1 format.
personaly I think this is dumb but who am I to judge ;)

so if my search pattern is:
"(\s)ks ?#?(\d*)(\s)"

then my replacement pattern should be:
"$1KS $2$3"


You're suffering from sed-think. While perl supports \<digit backreferences
in the RHS of s///, man perlre(1) is clear that $<number is preferred. MSFT
seems to have decided to implement only the preferred perl syntax.


 
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
automated cut and paste using regex excel_newbie Excel Worksheet Functions 2 March 20th 09 12:29 PM
MS Query capabilities/regex Mike[_10_] New Users to Excel 2 June 23rd 08 09:19 PM
RegEx in VBE code editor R Avery Excel Programming 6 December 21st 04 01:58 PM
Regex Question William Barnes Excel Programming 5 January 2nd 04 11:57 AM
regex string matching Jamie Martin[_2_] Excel Programming 3 September 26th 03 09:28 PM


All times are GMT +1. The time now is 06:12 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"