Please fix the extract() function so flags will work
Flags simply do not work the way Frank suggests in this post...
6 replies
-
I can't help myself . Why would you use "i" or case insensitive mode when you are only extracting numbers?
-
How do you avoid fixing something in version 2.7?
-
Hi Sean, I think the function works just fine. Do you have a specific example? E.g.
extractx("Hello", "[a-z]+", "", "Result: $0") => "Result: ello"
extractx("Hello", "[a-z]+", "i", "Result: $0") => "Result: Hello"
Best, Frank
-
Hi Frank, here is an example...
let myVar := "ABC123DEF456";
extractx(myVar, "\D+", "g", "$0")
If it worked similarly to Javascript match(), it would return "ABCDEF" because of the global flag.
-
The purpose of extractx is to retrieve the (first) matching part of the string, not the not-matching part. \D+ matches the digits.
-
Hi Frank,
Then there is no point in having flags in the function. The global flag works in the replacex function. I had the impression the functions with "x" at the end were Regex functions. If that's the case, then the "g" or global flag would cause the function to match all the characters in the string that are not numbers in this example.
Gr眉脽e Sean
Content aside
- 4 yrs agoLast active
- 6Replies
- 1294Views