He later added this capability to the Unix editor ed, which eventually led to the popular search tool grep's use of regular expressions ("grep" is a word derived from the command for regular expression searching in the ed editor: g/ re/p meaning "Global search for Regular Expression and Print matching lines").
Regular expression not slash code#
For speed, Thompson implemented regular expression matching by just-in-time compilation (JIT) to IBM 7094 code on the Compatible Time-Sharing System, an important early example of JIT compilation. Among the first appearances of regular expressions in program form was when Ken Thompson built Kleene's notation into the editor QED as a means to match patterns in text files.
![regular expression not slash regular expression not slash](https://i.stack.imgur.com/Dkj41.png)
Regular expressions entered popular use from 1968 in two uses: pattern matching in a text editor and lexical analysis in a compiler. Other early implementations of pattern matching include the SNOBOL language, which did not use regular expressions, but instead its own pattern matching constructs. These arose in theoretical computer science, in the subfields of automata theory (models of computation) and the description and classification of formal languages. Regular expressions originated in 1951, when mathematician Stephen Cole Kleene described regular languages using his mathematical notation called regular events.
![regular expression not slash regular expression not slash](https://i.pinimg.com/736x/e6/d5/15/e6d51589bafbd9ab321eb0541a579857--javascript-methods-regular-expression.jpg)
![regular expression not slash regular expression not slash](https://i.stack.imgur.com/6hRxj.png)
It is a technique developed in theoretical computer science and formal language theory. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation. A blacklist on Wikipedia which uses regular expressions to identify bad titlesĪ regular expression (shortened as regex or regexp also referred to as rational expression ) is a sequence of characters that specifies a search pattern in text.