HiveBrain v1.2.0
Get Started
← Back to all entries
patternMajor

Unusual applications of regular expressions?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
unusualregularexpressionsapplications

Problem

I am looking for some interesting applications of regular expressions.

Can you name any unusual, or unobvious, cases where regexes find their application?

Solution

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) to English text.

For example if the user wants to write hello they presses 42556. Convert the input to [ghi][def][jkl][jkl][mno] and test this regex against the whole vocabulary: the word hello will match.

Context

StackExchange Computer Science Q#125296, answer score: 43

Revisions (0)

No revisions yet.