I found this post: Python Regex vs PHP Regex but I actually did not get if Python's REGEX syntax matches PHP's REGEX syntax.
I started to convert some of my old PHP code to python (due to g's appengine etc.), and now I would like to know whether the regex is 100% convertable, by simple copy & paste.
regards,
NET's RegEx, and in sum they all scale differently to Python's RegEx. Short answer is "no", although they're likely to be very similar whatever course you're doing, especially in terms of basics (so your course will definitely be applicable).
Regular expression synax varies slightly between languages but for the most part the details are the same. Some regex implementations support slightly different variations on how they process as well as what certain special character sequences mean.
The syntax and semantics of regexes have been standardized by IEEE as POSIX BRE and ERE . However, there are many non-standard variants. Often, the differences are subtle. Programmers who design regexes must be aware of the variant being used by the engine.
Java - Java 4 and later include an excellent regular expressions library in the java. util. regex package.
Python uses a syntax similar to the Perl syntax and PHP uses the Perl Compatible Regular Expressions syntax, so it should be nearly the same. Read about the possible differences.
The only real difference is that in PHP, the expression must be enclosed in delimiters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With