One of the main advantages POSIX of the NFA-machine - presence of standard realization. Therefore POSIX NFA-machines more slowly traditional and consequently it is impossible to force POSIX NFA to prefer shorter conformity long. POSIX NFA - machines are similar to traditional NFA-machines, except for "patience" - they continue the search, yet will not find the longest conformity.Such mechanisms of regular expressions are used in Perl, Python, Emacs, Tcl and. As traditional NFA accepts the first found conformity, it cannot find the longest ocurrences. But because of recoils, the traditional NFA can check the same place sometimes. As traditional NFA designs the certain expansions of regular expression for the search of conformity, it can search and backreferences.
Traditional NFA-machines (NonDeterministic Finite-state Automaton - not determined final automatic devices) uses "greedy" algorithm of recoil, checking all possible expansions of regular expression in the certain order and choosing the first suitable value.They are used, for example, in awk, egrep or lex. However, as DFA contains only a final condition, it cannot find the sample with the return reference and, because of the absence of designs with obvious expansion, does not catch subexpressions. They can find the longest possible string possible. DFA (Deterministic Finite-state Automaton - the determined final automatic devices) machines work linearly on time as do not require recoils (and never check one symbol twice).In practice are applied three types regular machine expressions. Replacement corresponding a pattern substrings.Search and delivery to the user corresponding a pattern of substrings.Stock-taking corresponding a pattern to a substring.Usually, by means of regular expressions, three actions are carried out. So, use of a pattern of search of type "text?.*" will find files textf.txt, text1.asp and others similar, but will not find text.txt or text.htm. The first one replaces a zero or more any symbols, the second - one any symbol.
A well-known example can be symbols "*" and "?", used in command line DOS.
It is carried out by means of viewing a string in searches of some pattern. A regular expression is one of the ways of searching substrings in strings.