Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which POSIX flavor of regex does Perl use?

Specifically, I'm using the Linux command:

$ find . -regextype posix-extended -regex '<some regex>' ...

I just want to make sure the POSIX type I'm using is the type Perl uses, since that is by far the one I am most familiar with.

like image 579
Kyle Avatar asked Apr 07 '10 16:04

Kyle


People also ask

What flavor of regex does Perl use?

Perl uses Perl regular expressions, not POSIX ones. You can compare the syntaxes yourself, for example in regex(7) .

What is POSIX in regex?

POSIX bracket expressions are a special kind of character classes. POSIX bracket expressions match one character out of a set of characters, just like regular character classes. They use the same syntax with square brackets. A hyphen creates a range, and a caret at the start negates the bracket expression.

Is Perl good for regex?

Perl has regex built directly into the language. Other programming languages need a module/library to use them. raw Perl without any modules, can handle regex.

What PCRE Perl Compatible Regular Expressions matching does?

The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE has its own native API, as well as a set of wrapper functions that correspond to the POSIX regular expression API.


1 Answers

Perl has defined its own standard for regexes. E.g., there are systems such as PCRE, which stands for Perl Compatible Regular Expressions.

like image 144
Paul Nathan Avatar answered Sep 19 '22 05:09

Paul Nathan