Nepedia
Back to Discover
Independent Reader
💻

Regular expression

technology Maturity 7-9 Next article →

Computers use special patterns to find text. We call these patterns regular expressions. People often call them regexes for short.

Stephen Cole Kleene
Stephen Cole Kleene

A mathematician named Stephen Cole Kleene started this idea. He worked on it in the 1950s.

A regex is a sequence of characters. These characters tell a computer how to match text. Some characters are literal. This means they match themselves. For example, the letter 'b' matches only 'b'. Other characters are metacharacters. These have special meanings. A dot is a metacharacter. It can match almost any single character.

Thompson-kleene-star
Thompson-kleene-star

You can use these tools to find or change words. They can also check if input is correct. You can use symbols to show how many times a letter appears. An asterisk means zero or more times. A plus sign means one or more times. A question mark means zero or one time. These rules help search engines and text editors work fast. Many programming languages use them today. Some new tools even use special hardware to make them faster.

169 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (2)
File:Stephen Cole Kleene.jpg
Stephen Cole Kleene.jpg
File:Thompson-kleene-star.svg
Thompson-kleene-star.svg
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.