Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Who defines regular expressions?

The W3C defines the HTML standard, CSS standard, and some other standards. I know there are other groups who define standards as well. Who defines the syntax of regular expressions?

like image 551
joshreesjones Avatar asked Nov 28 '13 03:11

joshreesjones


People also ask

Why are regular expressions called regular?

@Nick Pierpoint: "Regular expressions are "regular" because they are defined by a finite set of symbols - a formal language." THIS IS WRONG. Regular expressions easily define infinite languages.

What is regular expression in automata theory?

A regular expression can be defined as a language or string accepted by a finite automata.

Is regex a programming language?

Regex has its own terminologies, conditions, and syntax; it is, in a sense, a mini programming language. Regex can be used to add, remove, isolate, and manipulate all kinds of text and data. It could be used as a simple text editor command, e.g., search and replace, or as it's own powerful text-processing language.

Which language is described by regular expressions?

Regular Expressions describe exactly the regular languages. If E is a regular expression, then L(E) is the regular language it defines. For each regular expression E, we can create a DFA A such that L(E) = L(A).


2 Answers

Regular expressions are covered by several standard bodies, including IEEE standard 1003.1 (so called Posix): http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap09.html

However, there are plenty of other approaches to regular expression syntax, the other popular one being Perl (PCRE). For a nice overview of all major regular expression implementations, including extensions, check out this useful resource: http://www.regular-expressions.info/tools.html

like image 132
oakad Avatar answered Oct 19 '22 08:10

oakad


Regular expressions originated from unix and are a part of the Perl language. If a regular expression language is similar to Perl's regular expressions, it is called Perl Compatible Regular Expressions (PCRE)

like image 31
6 revs Avatar answered Oct 19 '22 07:10

6 revs