Home > Article > Backend Development > Are regular expressions in java the same as regular expressions in JavaScript? Is it the same as in php etc.?
It’s so easy for a newbie to learn
I randomly searched on Baidu and found that many languages involve regular expressions, such as java php JavaScript and so on. It feels quite important. I watched some videos myself and was confused by the learning.
Are they similar in general?
It’s so easy for a newbie to learn
I randomly searched on Baidu and found that many languages involve regular expressions, such as java php JavaScript and so on. It feels quite important. I watched some videos and learned a lot.
Are they similar in general?
Basically the rules are the same, but there are differences in usage. After all, the language features are different
There are two different forms. See the summary below, but some features are not supported in different languages.
http://zonxin.github.io/post/2015/08/regular-expression-cheetsheet
The languages you listed all support regular expressions in PCRE format. Another commonly used format is POSIX format, which is supported by older versions of PHP.
Of course, there are subtle differences between the two PCRE schools. You can just learn any one and check the documentation if you encounter any differences. If you are interested, you can read the book "Regular Guide", which summarizes and compares the implementation of regular expressions in different programming languages in detail.