Originally posted by Derek Stukey
Hi All,
I am trying to use a regexp to search on the string "SSS". If this string is found in a particular segment, then capture all characters which come BEFORE the "SSS" and save them to a variable.
The issue is the fact that the regexp does not search on "SSS", but rather just "S". So, if a capital S appears anywhere before the "SSS", all of the logic is blown for the rest of the script.
The string I am testing with is:
General SisterSSS001ABC123 InformationIf the regexp works correctly, the appropriate output would be "Sister" to the caputuring variable.
I have tried the following options and have not gotten the desired result:
A. regexp {(^[SSS]*)} <Variable I am reading from> <variable to capture result>
A1. Output: S
B. regexp {(^(SSS)*)} <Variable I am reading from> <variable to capture result>
B1. Output: <Nothing>
C. regexp {([^"SSS"]*)} <Variable I am reading from> <variable to capture result>
C1. Output: <Nothing>
I have tried a few other variations, but in all cases, the regexp continues to focus on the first instance of "S" and not the "SSS".
Does anyone know the syntax to isolate a string of the same letters using regexp? Or, am I wasting my time?
Thanks,