Lisp und Regex
This commit is contained in:
@@ -40,6 +40,14 @@ Beispiel
|
|||||||
|
|
||||||
**`setq` / `setf`**: Ändert den Wert einer bereits existierenden Variablen oder erzeugt (in manchen Lisp-Dialekten) implizit eine globale Variable, was jedoch unsauber ist. `setf` ist der universelle Zuweisungsoperator.
|
**`setq` / `setf`**: Ändert den Wert einer bereits existierenden Variablen oder erzeugt (in manchen Lisp-Dialekten) implizit eine globale Variable, was jedoch unsauber ist. `setf` ist der universelle Zuweisungsoperator.
|
||||||
|
|
||||||
|
`setq` - einfache Variablenzuweisung
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setf - allgemeine Zuweisung
|
||||||
|
|
||||||
|
`setf` kann nicht nur Variablen setzen, sondern praktisch alles, wofür Lisp eine passende **Schreibstelle (place)** kennt:
|
||||||
|
|
||||||
(setf *mein-wert* 100)
|
(setf *mein-wert* 100)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,30 +12,25 @@ https://serverdiscounter.com/blog/2026-01-26-regex-grundlagen
|
|||||||
|
|
||||||
## Special Characters
|
## Special Characters
|
||||||
|
|
||||||
| | |
|
| | |
|
||||||
| ---- | ------------------------------------------------------------------------------- |
|
| -------- | ------------------------------------------------------------------------------- |
|
||||||
| `\` | Escapet Sonderzeichen oder kennzeichnet eine spezielle Sequenz |
|
| `\` | Escapet Sonderzeichen oder kennzeichnet eine spezielle Sequenz |
|
||||||
| `.` | Entspricht einem beliebigen einzelnen Zeichen mit Ausnahme eines Zeilenumbruchs |
|
| `.` | Entspricht einem beliebigen einzelnen Zeichen mit Ausnahme eines Zeilenumbruchs |
|
||||||
| `^` | Matches the start of the string. |
|
| `^` | Matches the start of the string. |
|
||||||
| `$` | Matches the end of the string |
|
| `$` | Matches the end of the string |
|
||||||
| `*` | Greedily matches 0 or more repetitions of the preceding RE. |
|
| `*` | Greedily matches 0 or more repetitions of the preceding RE. |
|
||||||
| `*?` | Matches 0 or more repetitions of the preceding RE. |
|
| `*?` | Matches 0 or more repetitions of the preceding RE. |
|
||||||
| `+` | Greedily matches 1 or more repetitions of the preceding RE. |
|
| `+` | Greedily matches 1 or more repetitions of the preceding RE. |
|
||||||
| `+?` | Matches 1 or more repetitions of the preceding RE. |
|
| `+?` | Matches 1 or more repetitions of the preceding RE. |
|
||||||
| ? | Greedily matches 0 or 1 repetitions of the preceding RE. |
|
| `?` | Greedily matches 0 or 1 repetitions of the preceding RE. |
|
||||||
| ?? | Matches 0 or 1 repetitions of the preceding RE. |
|
| `??` | Matches 0 or 1 repetitions of the preceding RE. |
|
||||||
|
| `A\|B` | Matches A, if A is unmatched then matches B, where A and B are arbitrary REs. |
|
||||||
|
| `{m}` | Matches exactly m many repetitions of the previous RE. |
|
||||||
|
| `{m,n}` | Greedily matches from m many to n many repetitions of the previous RE. |
|
||||||
|
| `{m,n}?` | Matches m many to n many repetitions of the previous RE. |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
A|B Matches A, if A is unmatched then matches B, where A and B are arbitrary REs.
|
|
||||||
{m} Matches exactly m many repetitions of the previous RE.
|
|
||||||
{m,n} Greedily matches from m many to n many repetitions of the previous RE.
|
|
||||||
{m,n}? Matches m many to n many repetitions of the previous RE.
|
|
||||||
|
|
||||||
[...] Indicates a set of characters to match.
|
[...] Indicates a set of characters to match.
|
||||||
[amk] Matches 'a', 'm', or 'k'.
|
[amk] Matches 'a', 'm', or 'k'.
|
||||||
[a-z] Matches 'a' through 'z'.
|
[a-z] Matches 'a' through 'z'.
|
||||||
|
|||||||
Reference in New Issue
Block a user