I am trying to extract the last word from a user attribute string.
The user attribute is AAA.USER.ATTRIBUTE(7)
The attribute value string is e.g. "ord1 ord2 ord3 ord4"
If I use the expression
AAA.USER.ATTRIBUTE(7).AFTER_REGEX(re/\s/)
my result is "ord2 ord3 ord4" i.e. i get everything after the first blank space.
I've had a lengthy dialogue with Copilot and an almost as tedious with ChatGPT, they both suggest something like
AAA.USER.ATTRIBUTE(7).AFTER_REGEX(re/s(\w+)$/)
However, that returns a NULL value.
Anyone who knows how I could get that last word?
Both cases:
AAA.USER.ATTRIBUTE(7) = "ord1 ord2 ord3 ord4"
Test 1:
AAA.USER.ATTRIBUTE(7).AFTER_REGEX(re/\s/)
Expected and actual result: "ord2 ord3 ord4" - all after first whitespace
Test 2:
AAA.USER.ATTRIBUTE(7).AFTER_REGEX(re/s(\w+)$/)
Expected result according to ChatGPT and Copilot: "ord4"
Actual result: UNDEF (the result in Netscaler GUI's Expression Evaluator)
"ord1 ord2 ord3 ord4".