What's different between Python and Javascript regular expressions?

后端 未结 3 1985
抹茶落季
抹茶落季 2020-12-03 10:08

Are Python and JavaScript regular expression syntax identical?

If not, then:

  1. What are the important differences between them
  2. Is there a pyth
相关标签:
3条回答
  • 2020-12-03 10:14

    There is a comparison table here:

    Regex Flavor Comparison

    0 讨论(0)
  • 2020-12-03 10:15

    Part 1
    They are different; One difference is Python supports Unicode and Javascript doesn't.

    Part 2
    Read Mastering Regular Expressions. It gives information on how to identify the back-end engines (DFA vs NFA vs Hybrid) that a regex flavour uses. It gives tons of information on the different regex flavours out there.

    There is way too much information to convey on a single SO answer, so you're better off having a solid piece of reference material on the subject.

    0 讨论(0)
  • 2020-12-03 10:31

    http://www.regular-expressions.info/javascript.html vs http://www.regular-expressions.info/python.html

    0 讨论(0)
提交回复
热议问题