Is the regular expression in java the same as that in JavaScript? Is it the same as php?

Source: Internet
Author: User
I searched Baidu and found that many languages involve regular expressions, such as javaphpJavaScript. It is important. I watched some videos and learned a little dizzy. Is it similar in general? Cainiao
I searched Baidu and found that many languages involve regular expressions, such as java php JavaScript. It is important. I watched some videos and learned a little dizzy.
Is it similar in general?

Reply content:

Cainiao
I searched Baidu and found that many languages involve regular expressions, such as java php JavaScript. It is important. I watched some videos and learned a little dizzy.
Is it similar in general?

Basically, the rules are the same, but they are used differently. after all, the language features are different.

There are two different forms. The following is a summary, but some features are not supported in different languages.
Http://zonxin.github.io/post/2015/08/regular-expression-cheetsheet

All the languages you listed support regular expressions in the PCRE format. another common format is the POSIX format, which is supported by older PHP versions.

Of course, there are also minor differences between the PCRE sects. you can learn either of them, and check the document again when there are differences. If you are interested, read the regular expression guide book, which summarizes and compares the implementation of regular expressions in different programming languages in detail.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.