According to Wikipedia, a regular expression (abbreviated regex or regexp) is a sequence of characters that forms a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace"-like operations.

learn more… | top users | synonyms (1)

159
votes
17answers
30k views

What is meant by “Now you have two problems”?

There is a popular quote by Jamie Zawinski: Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. How is this quote supposed to ...
69
votes
10answers
8k views

Readable regular expressions without losing their power?

Many programmers know the joy of whipping up a quick regular expression, these days often with help of some web service, or more traditionally at interactive prompt, or perhaps writing a small script ...
3
votes
2answers
172 views

Need overview of concepts and tools to translate a DSL to regular expressions

I'm looking for a little guidance. Until this morning, this was all over my head. After spending today researching Wikipedia, StackOverflow, etc., I'd say I've got my nose above the water. I'm tasked ...
42
votes
4answers
10k views

When you should NOT use Regular Expressions?

Regular expressions are powerful tool in programmer's arsenal, but - there are some cases when they are not a best choice, or even outright harmful. Simple example #1 is parsing HTML with regexp - a ...
90
votes
25answers
21k views

How far should one take e-mail address validation?

I'm wondering how far people should take the validation of e-mail address. My field is primarily web-development, but this applies anywhere. I've seen a few approaches: simply checking if there is ...
23
votes
17answers
7k views

Why are regular expressions so morbidly attractive?

Exhibit 1, Exhibit 2, I guess you won't find it hard to recall other examples. Thing is: if there is more than one way to solve a problem, the PHP programmer (I usually browse the PHP tag on ...
13
votes
6answers
714 views

What can / should be done with regular expressions? [closed]

I've recently learnt regular expressions and I love writing / using them. I'm looking for ideas and more opportunities to use them, however I don't want to overuse them as an all purpose tool, as ...