Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
replace with regular expression
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
My answer is also same and resembels like Anku and Surya's comments but still to make easiar to understand i m ginving the expample here. Hope it may helpful for Kamal

Code:
'Function ReplaceTest(patrn, replStr)
  Dim regEx, str1               ' Create variables.
  str1 = "hello1234"
  Set regEx = New RegExp            ' Create regular expression.
  patrn="hello1234"
  replStr="hello"
  regEx.Pattern = patrn            ' Set pattern.
  regEx.IgnoreCase = True            ' Make case insensitive.
  ReplaceTest = regEx.Replace(str1, replStr)   ' Make replacement.
'End Function

MsgBox ReplaceTest     ' Replace 'fox' with 'cat'.

Regards
Raj
Reply


Messages In This Thread
replace with regular expression - by kamalteja - 04-11-2008, 12:57 PM
RE: replace with regular expression - by Ankur - 04-11-2008, 03:31 PM
RE: replace with regular expression - by aditya - 07-15-2008, 10:19 AM
RE: replace with regular expression - by Rajashekar Gouda - 07-28-2008, 06:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 3,484 10-05-2016, 11:05 AM
Last Post: Ankur
  Regular expression to read two words in lowercase, uppercase and with and without spa sarahq49 1 3,351 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 3,817 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 16,564 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,114 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 3 Guest(s)