Regex Definition and 3 Discussions

A regular expression (shortened as regex or regexp; also referred to as rational expression) is a sequence of characters that specifies a search pattern. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation. It is a technique developed in theoretical computer science and formal language theory.
The concept arose in the 1950s when the American mathematician Stephen Cole Kleene formalized the description of a regular language. The concept came into common use with Unix text-processing utilities. Different syntaxes for writing regular expressions have existed since the 1980s, one being the POSIX standard and another, widely used, being the Perl syntax.
Regular expressions are used in search engines, search and replace dialogs of word processors and text editors, in text processing utilities such as sed and AWK and in lexical analysis. Many programming languages provide regex capabilities either built-in or via libraries, as it has uses in many situations.

View More On
  1. Wrichik Basu

    Understanding the NAME_REGEX in Linux (used for checking usernames)

    I was helping one of my classmates to set up the Ubuntu app on Windows 10 so that he can do Bash programming. While setting the username, he was getting an error due to bad regex, and that prompted me to look up the regex for username on Linux. This regex is stored in /etc/adduser.conf file. The...
  2. MesonMarcus

    Can you solve this puzzle involving regular expressions?

    can anyone help solve this puzzle regarding regular expressions? I was given this in an interview test from BAE systems cyber security department a few years ago and just came across it again, still haven't managed to get anywhere like an answer. I have tried matching each line of regex to form...
  3. T

    Help understanding Non-determinate Finite Automaton

    Homework Statement There's not a particular problem, per se, just that I seem to be missing something with my understanding of how to evaluate a string against a non-deterministic finite automaton with epsilon transitions. But one I've been working with is shown below Homework Equations NA...