Looking in a string for specific leading four characters (like "AZTL" or "BYML" or "CXGR" only at beginning of the string).
Want to remove the second and fourth character.
Here is the code
var vNewString as String
var vLookin as String
var vFind as String
var vUse as String
vLookin = "AZTLCDEFG"
vFind = "^[(A)(Z)(T)(L)|(B)(Y)(M)(L)|(C)(X)(G)(R)](.*)"
vUse = "$1$3$5"
vNewString = @RegexReplaceString(vLookIn,vFind,vUse,0)
WriteLn(vNewString)
vNewString should be "ATCDEFG" but it is $1$3$5 instead.
I have tried different variations of vFind without success, but this one seems to be closest to what I think it should look like. Can you see the error(s) and help with a modification?
The specific Find strings will be dynamically changing, and may not always be the 2nd/4th chars that are dropped, so
I don't think it lends itself to a bunch of IF strings. I think it needs to use RegEx type of replacement of string patterns. That will allow me to just redefine the two variables, vFind and vUse.
--------------
Question about Sesame's flavor of RegEx: I know there are some different flavors of RegEx. Which flavor of RegEx is closest to SBasic:
JGsoft/.NET/Java/Perl/ECMA/Python/Ruby/Tcl/PHP ereg/PHP preg/REAL basic/Oracle/Post gres/XPath/R