RegEx: Unterschied zwischen den Versionen

Aus MattWiki
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 30: Zeile 30:
|-
|-
| Single Character  || .
| Single Character  || .
|-
| Grouping with alternatives  || (Mon|Tues)day
|-
| Word and text boundaries  || b ^ $
|}
{| class="wikitable"
|+ style="text-align: left" | Multiplier
! Multiplier !! Example
|-
|-
| Multiplier  || {42}, {4,20}
| Multiplier  || {42}, {4,20}
|-
|-
| One or multiple characters || +
| One or more characters || +
|-
|-
| Zero or one character  || ?
| Zero or one character  || ?
|-
|-
| Zero or multiple characters  || *
| Zero or more characters  || *
|-
| Grouping with alternatives  || (Mon|Tues)day
|-
| Word and text boundaries  || b ^ $
|}
|}

Version vom 28. August 2021, 14:33 Uhr

Notes for RegEx respectively Regular Expressions.

Guide (german): https://t3n.de/news/regex-guide-t3n-552858/

General Rules

Character Types
Type Example
Literal a b c 1 2 3
Meta characters . [[ ] { } ? * + | ( ) ^ $


Meaning of meta characters
Meaning Example
Character class digit d
Character class character w
Character class whitespace s
Inversion of Character Classes D, W, S, [^abc]
Character class range [a-c]
Single Character .
Grouping with alternatives Tues)day
Word and text boundaries b ^ $


Multiplier
Multiplier Example
Multiplier {42}, {4,20}
One or more characters +
Zero or one character ?
Zero or more characters *