You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a case where Perl code and generated Java code differ in implementation. Basically if we generate in Perl a regexp in real time (as a string) and use it to evaluate a pattern the regexp will fail if we have escapes. What happens is that in Perl \\s has to be used but in Java \\\\s need to be used.
Trying 'a b c' =~ /a\sb\sc/
Ok 'a b c' =~ /a\sb\sc/
Java output:
Trying 'a b c' =~ /asb\sc/
Exception in thread "main" PlDieException: Failed regexp clean: 'a b c' =~ /asb\sc/
at PlCORE.die(Main.java:114)
at Main.main(Main.java:3514)
This is a case where Perl code and generated Java code differ in implementation. Basically if we generate in Perl a regexp in real time (as a string) and use it to evaluate a pattern the regexp will fail if we have escapes. What happens is that in Perl
\\s
has to be used but in Java\\\\s
need to be used.Example:
Perl output:
Java output:
If we modify the original program to this:
Then we get a failure in Perl:
But a success in Java:
The text was updated successfully, but these errors were encountered: