(?=foo) Lookahead Asserts that what immediately follows the current position in the string is foo
(?<=foo) Lookbehind Asserts that what immediately precedes the current position in the string is foo
(?!foo) Negative Lookahead Asserts that what immediately follows the current position in the string is not foo
(?<!foo) Negative Lookbehind Asserts that what immediately precedes the current position in the string is not foo
you cannot use a negated character class to match a q not followed by a u. Negative lookahead provides the solution: q(?!u).
Positive lookahead works just the same. q(?=u) matches a q that is followed by a u
Regular expressions is the term used for a codified method of searching invented or defined by the American mathematician Stephen Kleene. The syntax (language format) described is compliant with extended regular expressions (EREs) defined in IEEE POSIX 1003.2 (Section 2.8). EREs are now commonly supported by Apache, PHP4, Javascript 1.3 , MS Visual Studio, MS Frontpage, most visual editors, vi, emac, the GNU family of tools (including grep, awk and sed) as well as many others. Extended Regular Expressions (EREs) will support Basic Regular Expressions (BREs are essentially a subset of EREs). Most applications, utilities and laguages that implement RE's extend the capabilities defined. The appropriate documentation should always be consulted.
Esta página tem o intuito de reunir material concernente a Expressões Regulares (Regex, regexp, ER). Se você tem algo para acrescentar, registre-se e colabore para disponibilizarmos uma melhor informação.