regular expression functions in the set_var command
Are regular expression functions supported in the set_var expression options?
I am trying to extract the nth character from a string of characters. One way to do that is to use the regular expression functions "sub()" or "substr()"
Examples might look like this:
class_code = "abcdefghijkl"
Extracting the 6th string position would give be the letter "f"
Using these functions,
sub("^.....(.)*", "\\1", "@class_code")
substr("@class_code",6, 6)
Currently what I get back is something that looks like:
Set @sixth_char=sub^.....(.)*, \\1, abcdefghijkl
or
Set @sixth_char=abcdefghijkl,6, 6
So, clearly the functions are not working the way I am using them. If the functions do not work is there a method for extracting the nth string position.
Please sign in to leave a comment.