In the regex world what's a flavor and which flavor does Java use?

前端 未结 5 566
无人及你
无人及你 2020-12-10 12:23

I\'m not a native English and so I don\'t understand well the meaning of \'flavor\' may be is it referred to a regex syntax?? and if so how many regex syntax are there?

5条回答
  •  再見小時候
    2020-12-10 12:55

    There are many different variations of what features a regex engine implements, what technique it uses "under the hood" and what syntax it uses for certain features.

    There is a very good article and comparison table at regular-expressions.info.

    The Java regex package implements a "Perl-like" regular expressions engine, but it has some extra features like possessive quantifiers (.*+) and variable-length (but finite) lookbehind assertions). On the other hand, it misses a few features Perl has, namely conditional expressions or comments. All in all, it's a very full-featured implementation.

提交回复
热议问题