08-24-2010 04:45 PM
I got an error when I run the attached code. When I get rid o the comma after the last %s, the error would be gone though. What's going on?
yik
08-24-2010 05:04 PM
%s matches a string up to the next space, I believe. Since a comma is a valid character, %s is matching "C,". If you specify %1S then you can keep the comma because it will match only 1 character, and the comma will not be part of the match.
Wow, I'm actually learning this regular expression nightmare.
08-24-2010 05:48 PM
@tbob wrote:
Wow, I'm actually learning this regular expression nightmare.
This is actually a format string, which to most people is just a bad dream.
If you do not know the length of the LocCT string you could replace '%s,' or '$1s,' with '%[^,],' which will give you a string with all characters except a comma followed by a comma.