Regular-Expression: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 183: | Zeile 183: | ||
! Ausdruck || Bedeutung | ! Ausdruck || Bedeutung | ||
|- | |- | ||
− | | <code> | + | | <code>\</code> |
− | | | + | | Nothing, but quotes the following character |
|- | |- | ||
− | | <code> | + | | <code>\Q</code> |
− | | | + | | Nothing, but quotes all characters until \E |
+ | |- | ||
+ | | <code>\E</code> | ||
+ | | Nothing, but ends quoting started by \Q | ||
|} | |} | ||
Zeile 195: | Zeile 198: | ||
! Ausdruck || Bedeutung | ! Ausdruck || Bedeutung | ||
|- | |- | ||
− | | <code> | + | | <code>(?:X)</code> |
− | | | + | | X, as a non-capturing group |
+ | |- | ||
+ | | <code>(?idmsux-idmsux)</code> | ||
+ | | Nothing, but turns match flags on - off | ||
+ | |- | ||
+ | | <code>(?idmsux-idmsux:X)</code> | ||
+ | | X, as a non-capturing group with the given flags on - off | ||
+ | |- | ||
+ | | <code>(?=X)</code> | ||
+ | | X, via zero-width positive lookahead | ||
+ | |- | ||
+ | | <code>(?!X)</code> | ||
+ | | X, via zero-width negative lookahead | ||
+ | |- | ||
+ | | <code>(?<=X)</code> | ||
+ | | X, via zero-width negative lookahead | ||
|- | |- | ||
− | | <code> | + | | <code>(?>X)</code> |
− | | | + | | X, as an independent, non-capturing group |
|} | |} | ||
Version vom 15. Juni 2008, 07:01 Uhr
Dieser Artikel bedarf einer Überarbeitung. Näheres ist auf der Diskussionsseite angegeben. Hilf bitte mit ihn zu verbessern und entferne anschließend diese Markierung. |
Beschreibung
Reguläre Ausdrücke sind Muster, mit denen man den Aufbau von Zeichenketten beschreibt.
Characters
Ausdruck | Bedeutung |
---|---|
x
|
The character x |
\\
|
The backslash character |
\0n
|
The character with octal value 0n (0 <= n <= 7) |
\0nn
|
The character with octal value 0nn (0 <= n <= 7) |
\0mnn
|
The character with octal value 0mnn (0 <= m <= 3, 0 <= n <= 7) |
\xhh
|
The character with hexadecimal value 0xhh |
\uhhhh
|
The character with hexadecimal value 0xhhhh |
\t
|
The tab character ('\u0009') |
\n
|
The newline (line feed) character ('\u000A') |
\r
|
The carriage-return character ('\u000D') |
\f
|
The form-feed character ('\u000C') |
\a
|
The alert (bell) character ('\u0007') |
\e
|
The escape character ('\u001B') |
\cx
|
The control character corresponding to x |
Character classes
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
Predefined character classes
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
POSIX character classes (US-ASCII only)
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
Classes for Unicode blocks and categories
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
Boundary matchers
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
Greedy quantifiers
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
Reluctant quantifiers
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
Possessive quantifiers
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
Logical operators
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
Back references
Ausdruck | Bedeutung |
---|---|
xxx
|
xxx |
xxx
|
xxx |
Quotation
Ausdruck | Bedeutung |
---|---|
\
|
Nothing, but quotes the following character |
\Q
|
Nothing, but quotes all characters until \E |
\E
|
Nothing, but ends quoting started by \Q |
Special constructs (non-capturing)
Ausdruck | Bedeutung |
---|---|
(?:X)
|
X, as a non-capturing group |
(?idmsux-idmsux)
|
Nothing, but turns match flags on - off |
(?idmsux-idmsux:X)
|
X, as a non-capturing group with the given flags on - off |
(?=X)
|
X, via zero-width positive lookahead |
(?!X)
|
X, via zero-width negative lookahead |
(?<=X)
|
X, via zero-width negative lookahead |
(?>X)
|
X, as an independent, non-capturing group |
Embedded flag expressions
Ausdruck | Bedeutung |
---|---|
(?u)
|
Pattern.UNICODE_CASE |
(?s)
|
Pattern.DOTALL |
(?m)
|
Pattern.MULTILINE |
(?i)
|
Pattern.CASE_INSENSITIVE |
(?x)
|
Pattern.COMMENTS |
(?d)
|
Pattern.UNIX_LINES |
---
|
Pattern.CANON_EQ (not available) |