web stats
Mirth Community - View Single Post - Puzzling Javascript Error in Regexp on Mirth
View Single Post
Old 08-19-2019, 08:42 AM
agermano agermano is offline
Mirth Guru
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,176
agermano is on a distinguished road

If you pass a javascript regular expression as the first parameter, it will work if you're calling it on a javascript string, and it won't work on a java string, because it's expecting either a char or CharSequence as the first parameter, and Rhino can't tell which one you meant to call.

If you pass strings as both parameters, it will work because both the java and js methods behave the same way in this case, and the javascript strings will get converted to CharSequences when called on a java string, so it's not ambiguous like when passing a regex.
Reply With Quote