I have a string that is output as a date:
#{bean.someString}
I want to take that string and manipulate it using regular expressions like so:
- original string: “11/22”
- expected string: “22/11”
I have tried to use a regular expression using f:replace, such as:
#{fn:replace(bean.someString, "(.*?)/(.*?)", "$2/$1")}
But it comes out as:
- actual string: “/1122”
Anyone know how I can do this? Thanks in advance.
Below is the answer (after much tribulation).
Because I have a fixed set of characters to traverse I can use the following to get the correct replacement:
Craziness that normal regex doesn’t work here.