1
I’m trying to evaluate a PHP code using Java, for that I need to replace in the code all "
for \"
. The problem is that Java also has this escape character to put "
in a String.
Told me to use \\"
, but the result was this:
Does anyone know how to type this? Or any way to run PHP inside the JVM? (I’m doing a trick that boils down to running on the terminal echo "codigo" | php
... It’s working, but there’s this little problem with "
).
Thank you
Beware of evaluating codes. If you have any possibility of user input, your program may have a high risk of vulnerability.
– Mateus
Try to use
\\\"
, The first two bars will be transformed into one for the string, and the\"
will be the literal character"
.– Mateus
Was solved using
\\\"
, Thank you guys. As for the "evaluator" care, I have a handle on this, thank you for warning =)– NathanPB
@Mateusa., put your comment in response, so Nathan can mark it as correct, thus helping the community.
– Marcos Henzel
Possible duplicate of How to indicate in a regex that the symbols '(' and ')', the parentheses, are one of the alternatives in a list of symbols in Java?
– Mateus
To run PHP in the JVM: http://j-php.net/
– Oralista de Sistemas
Vote today! Vote tomorrow! Vote forever! Vote consciously! Your vote is very important to our community, contribute to us, and help make Stack Overflow in Portuguese (Sopt) bigger and bigger. You can learn more at: Vote early, vote often
– Marcos Henzel