Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
replace with regular expression
#4
Solved: 12 Years, 10 Months, 2 Weeks ago
The below example i am tryiong to convert all the <TODAY> with Current Date.

In the same way you can pass any regular expression.

Code:
str  = "Today is <TODAY>"

Dim oRe, oMatches,Match,str2
Set oRe = New RegExp
oRe.IgnoreCase = True
oRe.Global = true
oRe.Pattern = "<TODAY>"
Set oMatches = oRe.Execute(str)
For each Match in oMatches
    str = Replace(str, Match.Value,Date)          
Next

print str 'will print Today is 07/28/2008
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 surya_7mar - 07-28-2008, 04:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 3,990 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,724 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 4,317 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 17,006 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,408 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 1 Guest(s)