Recursion

Regexp

? define the group name S for the expression enclosed in parenthesis. ie (A \gB)? * (A \gB)? defines that the expression A \gB should be found 0 or 1 (defined by the ? greedy quantifier) * A \gB defines a pattern that:
    * starts with the letter ''A'',
    * followed by the group ''S'' (the recursion)
    * then the letter ''B''
===== Syntax ===== You define a recursive expression by adding the group name * In PCRE (perl, php, java, …) (?R) * In Ruby \g<0> ===== Support ===== Recursion is not supported in all regular expression engines. The following engines supports them * PCRE (Perl, C, PHP, R…) * Ruby (2+) * Python with the alternate regex module





Discover More
Word Recognition Automaton
What is a Lexer ? known also as Tokenizer or Scanner - Lexical Analysis

Lexer are also known as: * Lexical analyzer * Lexical Tokenizer * Lexical Scanner Consider the following expression: A lexer will tokenized it in the following symbol table: Token Lexeme ...
Card Puncher Data Processing
Language - Regular Language

A regular language is a language that can be described by regular expressions. A language which cannot be described by a regular expression is called non-regular. Regular expressions are not very...



Share this page:
Follow us:
Task Runner