regular expression

(redirected from Regular expressions)

regular expression

[′reg·yə·lər ik′spresh·ən]
(computer science)
A formal description of a language acceptable by a finite automaton or for the behavior of a sequential switching circuit.

regular expression

(text, operating system)
(regexp, RE) One of the wild card patterns used by Perl and other languages, following Unix utilities such as grep, sed, and awk and editors such as vi and Emacs. Regular expressions use conventions similar to but more elaborate than those described under glob. A regular expression is a sequence of characters with the following meanings:

An ordinary character (not one of the special characters discussed below) matches that character.

A backslash (\) followed by any special character matches the special character itself. The special characters are:

"." matches any character except NEWLINE; "RE*" (where the "*" is called the "Kleene star") matches zero or more occurrences of RE. If there is any choice, the longest leftmost matching string is chosen, in most regexp flavours.

"^" at the beginning of an RE matches the start of a line and "$" at the end of an RE matches the end of a line.

[string] matches any one character in that string. If the first character of the string is a "^" it matches any character except the remaining characters in the string (and also usually excluding NEWLINE). "-" may be used to indicate a range of consecutive ASCII characters.

\( RE \) matches whatever RE matches and \n, where n is a digit, matches whatever was matched by the RE between the nth \( and its corresponding \) earlier in the same RE. Many flavours use ( RE ) used instead of \( RE \).

The concatenation of REs is a RE that matches the concatenation of the strings matched by each RE. RE1 | RE2 matches whatever RE1 or RE2 matches.

\< matches the beginning of a word and \> matches the end of a word. In many flavours of regexp, \> and \< are replaced by "\b", the special character for "word boundary".

RE\m\ matches m occurences of RE. RE\m,\ matches m or more occurences of RE. RE\m,n\ matches between m and n occurences.

The exact details of how regexp will work in a given application vary greatly from flavour to flavour. A comprehensive survey of regexp flavours is found in Friedl 1997 (see below).

[Jeffrey E.F. Friedl, "Mastering Regular Expressions, O'Reilly, 1997].

regular expression

(2)
Any description of a pattern composed from combinations of symbols and the three operators:

Concatenation - pattern A concatenated with B matches a match for A followed by a match for B.

Or - pattern A-or-B matches either a match for A or a match for B.

Closure - zero or more matches for a pattern.

The earliest form of regular expressions (and the term itself) were invented by mathematician Stephen Cole Kleene in the mid-1950s, as a notation to easily manipulate "regular sets", formal descriptions of the behaviour of finite state machines, in regular algebra.

[S.C. Kleene, "Representation of events in nerve nets and finite automata", 1956, Automata Studies. Princeton].

[J.H. Conway, "Regular algebra and finite machines", 1971, Eds Chapman & Hall].

[Sedgewick, "Algorithms in C", page 294].

regular expression

In programming, a set of symbols used to search for occurrences of text or to search and replace text. The simplest regular expressions are DOS/Windows wildcards; for example, *.html refers to all file names with HTML extensions. However, regular expression functions are available in many programming languages that allow for complex pattern matching and text manipulation. For example, replacing specific text within a sentence when the sentence begins with a certain word can be performed with a regular expression. See expression.
References in periodicals archive ?
Rather than rely on regular expressions to control for proper hostname identification, CAL can remove the clutter by using the latest TLD listings.
* Text mining agents integrated into the indexing engine that detect regular expressions and/or complex "shapes" that describe the likely meaning of specific terms and phrases and then normalize them for use across the enterprise.
Along the way Linux users will learn the timeless skills handed down by generations of experienced, mouse-shunning gurus: file navigation, environment configuration, command chaining, pattern matching with regular expressions, and more.
Computer reference collections appealing to data scientists and professional learners who want a quick pocket reference for refresher purposes will find Regular Expressions Pocket Primer the perfect pick for technical pursuit.
It also explains schema languages and workflows for XML validation, cataloging workflows using XSLT, the basics of XQuery (including use cases and XQuery expressions and functions), and working with strings and sequences (including regular expressions).
The open source rules repository uses regular expressions to detect and classify content and is able to be used in other projects aside from the SME File Fabric.
The Helios RegEx processor is proficient in analysing data at full network throughput rates reaching 100 Gb/s in FPGA technology and can scan up to 1 million complex regular expressions in parallel.
This search is performed by a combination of keyword search and regular expressions search.
The malware uses regular expressions combined cryptographic dashes used in Instagram to find its control server to send across data from infected PCs.
After an introduction to Scala, it covers the basics of object-orientation and software development, object-orientation in Scala, abstraction and polymorphism, GUIs (graphical user interfaces) and graphics, other collection types, stacks and queues, multithreading and concurrency, low-level multithreading and Java libraries, stream input/output and XML, networking, linked lists, priority queues, refactoring, recursion, trees, regular expressions and context-free parsers, binary heaps, direct access binary files, spatial trees, augmenting trees, and hash tables.
Our fuzzing procedure starts by analyzing the regular expressions of the corresponding input attributes (e.g., a date format or a telephone number format in HTML5).