Are regular expressions in java the same as regular expressions in JavaScript? Is it the same as in php etc.?

WBOY
Release: 2016-08-04 09:22:06
Original
1508 people have browsed it

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?

Reply content:

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.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!