Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace character expression
Message
From
10/07/2010 00:52:03
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01471799
Message ID:
01472124
Views:
39
>Try
>
>lcStr = "a [1-2] b [2-3] c [3-4] d [4-5] e [5-6] ... [9-10]"
>
>loRegEx = NEWOBJECT("VBScript.RegExp")
>loRegEx.Pattern = "\[([1-9])-([1-9])\]"
>loRegEx.Global = .T.
>lcNewStr = loRegEx.Replace(lcStr, "[0$1-0$2]")
>
>loRegEx.Pattern = "\[([1-9])-([1-9]\d)\]"
>lcNewStr = loRegEx.Replace(lcNewStr, "[0$1-$2]")
>
>
>? lcStr
>? lcNewStr
fantastic sergey - many thanks - works perfectly for me. I will spend the next couple of hours trying to figure out exactly what you've done.

k/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform