I am trying to use regular expressions in Java that are built for Perl's regex. My goal is to have a standardized set of regular expressions so that both our Java apps and Perl scripts are producing the same results when applying the regular expressions.
Is there a library that will take a perl regex such as: \bbypa(s|r)?\b
and use it directly in Java or do I need to escape special characters for each regular expression?
If I have to implement the second method (which I hope I can avoid), what are the characters that need to be escaped to function in Java?
Any insight into this will be helpful
Thanks!!
EDIT:
I have over 500 of these regular expressions sitting in the database. They all work perfect on perl. Do I just need to escape the backslashes when using these regex in Java and assume it produces the same results as Perl?