xdevel2000 xdevel2000 - 10 months ago 41
Java Question

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

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?

BRE ERE Perl etc.??

Answer Source
  • Flavor refers to the regex engine - the syntax and additional properties supported by the particular regex engine.
  • Pattern class documents the properties of the java regex engine
  • Aside from the basic things like the meaning of metacharacters, different implementations of regex engines support different types of syntaxes. For example
    • POSIX engines support [:digit:] for digits (same as [0-9]
    • Perl compatible engines support \d shortcut for digits.
    • JavaScript doesn't support look behinds
    • PHP and some others support look behinds, but needs them to be fixed length
    • Regex engines of text editors (Notepad++) generally don't support look around.