Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
REVERSE RGB(0,0,0,255,255,255) to RGB(255,255,255,0,0,0)
Message
 
 
To
13/06/2003 12:34:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00799797
Message ID:
00800047
Views:
33
Tracy,

You can change pattern a little bit to accommodate spaces around ','
oRE.Pattern = "(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)"
>
>OOPS, never mind, I just figured out that spaces matter. The below works:
>
>
>clear
>lcstring = "RGB(123, 124, 125, 126, 127, 128)"
>? lcstring
>oRE = CREATEOBJECT("VBScript.RegExp")
>oRE.Pattern = "(\d+)\, (\d+)\, (\d+)\, (\d+)\, (\d+)\, (\d+)"
>? oRE.Replace(lcstring, "$4, $5, $6, $1, $2, $3")
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform