Praise Be for Regular Expressions
I used a regular expression in VB for the first time ever (I think) today!
The reason is that I cached some generated ASP and realised that when I needed to use it on different pages, the id lookup for certain elements would change. So, no problem (except for the fact that I’m coding in ASP):
Dim regExpObj, file_content, newStr
Set regExptObj = new RegExp
With regExpObj
.Pattern = "idTag[0-9]" 'Matches the id name that I'm using,
'regardless of what number the generated code makes it
.Global = True 'Matches all occurrences, not just the first
End With
newStr = objRegExp.Replace (file_content, "idTag3")
response.write newStr
Easy.
Related posts:
- Install a Ranger Package Without Ranger Following on from my remove ranger script, here is a...
Related posts brought to you by Yet Another Related Posts Plugin.
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.