Hi. Does anyone know the best way to make a regex search case insensitive in JSL? For example, I wish to extract the file extension from a path name, and I don't want it to matter if the extension is ".csv" or ".CSV" or ".cSv". If I try the following, it will only work on filenames whose extensions are lowercase:
filename = Regex(path, "(.+\/)*([^\/]+)\.(csv|xlsx)$", "\2")
One method is to just convert the entire path to lowercase before doing regex on it, but for various reasons I don't want to do that.
filename = Regex(LowerCase(path), "(.+\/)*([^\/]+)\.(csv|xlsx)$", "\2")
The other method I tried is to use the "(?i)" modifier in the match string, but I get an error:
filename = Regex(path, "(?i)(.+\/)*([^\/]+)\.(csv|xlsx)$", "\2")
"regex found a quantifier *, +, ?, or { in an invalid position, the result is undefined in access or evaluation of 'Regex'". I'm guessing that modifier is not supported in JSL. Any ideas?