# Tag Info

## Hot answers tagged regular-expressions

42 votes

### Unusual applications of regular expressions?

I don't know if this question belongs here (the answer could be subjective and depend on your definition of "unusual") but here is my favorite unusual application of regex: converting T9 input (2-9)...
• 603
39 votes
Accepted

### Why is there no permutation in Regexes? (Even if regular languages seem to be able to do this)

The fundamental theorems of formal language theory are that regular expressions, regular grammars, deterministic finite automata (DFAs) and nondeterministic finite automata (NFAs) all describe the ...
• 80.9k
31 votes
Accepted

### Proving Equivalence of Two Regular Expressions

One way to prove that two regular expressions $r_1,r_2$ generate the same language is to show both inclusions: Show that if $w$ is generated by $r_1$ then it is generated by $r_2$. Show that if $w$ ...
• 273k
25 votes
Accepted

### Difference between regular expression and grammar in automata

Regular expressions, regular grammars and finite automata are simply three different formalisms for the same thing. There are algorithms to convert from any of them to any other. The basic reason ...
• 17.9k
25 votes
Accepted

### Is it possible to build any regular expression in a computer language with just 3 basic operators?

Regular expressions using only concatenation, alternation and Kleene star describe regular languages. In contrast, extended regular expressions available in modern programming languages can describe ...
• 273k
24 votes
Accepted

18 votes

### How to prove using pumping lemma that language generated by a(b*)c(d*)e is regular?

You can't. The pumping lemma can only be used to prove that a language is non-regular. How to prove that it is regular depends on how you've defined regular languages. You (or your course or textbook) ...
• 80.9k
18 votes

### Unusual applications of regular expressions?

From this page, here's a regex for validating an RFC822-compliant email address ...
17 votes

### Why is there no permutation in Regexes? (Even if regular languages seem to be able to do this)

So my question is: (Why) Is my proof wrong? If it is right: Why is there no easy way to express permutations? Your "proof" only looked at permutations of single words, which are finite ...
16 votes
Accepted

### When is a regexp not a Regular Expression?

tl;dr backrefs. As soon as there is a \1 (or any number that isn't used to escape unicode) in the regexp it is not a regular expression. Backrefs allows you to ...
• 4,224
16 votes
Accepted

### Why are regular expressions defined with union, concatenation and star operations?

1) If we also allow intersection and complement, then the resulting expressions are sometimes called extended regular expressions; as the regular languages are closed under boolean operations nothing ...
• 1,429
16 votes
Accepted

• 273k
11 votes

### Unusual applications of regular expressions?

A simple PCRE expression (not exactly an regular expression, this one includes a +?) can say if an unary number is non-prime (so when it doesn't match, the unary ...

Only top scored, non community-wiki answers of a minimum length are eligible