From 816b7384cfcc0e2b3c02001e638f6c7be1206324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20B=C3=BCltge?= Date: Thu, 29 Aug 2019 12:13:54 +0200 Subject: [PATCH 01/16] Start of Translation in German language. --- translations/README-de.md | 593 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 593 insertions(+) create mode 100644 translations/README-de.md diff --git a/translations/README-de.md b/translations/README-de.md new file mode 100644 index 0000000..f4e7e14 --- /dev/null +++ b/translations/README-de.md @@ -0,0 +1,593 @@ +

+
+ + Learn Regex + +

+ +## Translations: + +* [English](../README.md) +* [German](../translations/Readme-de.md) +* [Español](../translations/README-es.md) +* [Français](../translations/README-fr.md) +* [Português do Brasil](../translations/README-pt_BR.md) +* [中文版](../translations/README-cn.md) +* [日本語](../translations/README-ja.md) +* [한국어](../translations/README-ko.md) +* [Turkish](../translations/README-tr.md) +* [Greek](../translations/README-gr.md) +* [Magyar](../translations/README-hu.md) +* [Polish](../translations/README-pl.md) +* [Русский](../translations/README-ru.md) +* [Tiếng Việt](../translations/README-vn.md) + +## Was sind reguläre Ausdrücke + +> Ein regulärer Ausdruck ist eine Gruppe von Buchstaben und Symbolen, die benutzt werden um ein spezifisches Muster in einem Text zu finden +Ein regulärer Ausdruch ist ein Muster, das mit einem zu durchsuchenden Text von links nach rechts abgeglichen wird. Die Bezeichnung +"Regulärer Ausdruck" ist in der Praxis unüblich und stattdessen wird häufig die Englische Abkürzung "Regex" verwendet. Reguläre +Ausdrücke werden verwendet um Fragemente eines Textes zu ersetzen, Formulare zu validieren, Segmente eines Textes anhand eines +Musters zu extrahieren und für vieles mehr. + +Angenommen Du schreibst eine Applikation und möchtest die Regeln definieren, nach denen ein Benutzer seinen Benutzernamen auswählen +kann. Wir möchten festlegen, dass der Benutzernamen Buchstaben, Ziffern, Unter- und Bindestriche beinhalten darf. Außerdem wollen +wir die Anzahl der Zeichen limitieren, damit der Name nicht unlesbar wird. Dazu verwenden wir den folgenden regulären Ausdruck um +den Benutzernamen zu überprüfen: +

+

+ Regular expression +

+ +Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, `jo-hn_doe` und `john12_as`. Der Eingabe `Jo` wird +nicht akzeptiert, da sie einen Großbuchstaben enthält und zu kurz ist. + +## Table of Contents + +- [Basis Vergleiche](#1-basic-matchers) +- [Sonderzeichen](#2-meta-characters) + - [Punkt](#21-full-stop) + - [Character set](#22-character-set) + - [Invertierter Zeichensatz](#221-negated-character-set) + - [Wiederholungen](#23-repetitions) + - [Stern *](#231-the-star) + - [Plus +](#232-the-plus) + - [Fragezeichen ?](#233-the-question-mark) + - [Klammern](#24-braces) + - [Zeichengruppen](#25-character-group) + - [Alternation](#26-alternation) + - [Auswertung von Sonderzeichen](#27-escaping-special-character) + - [Anker](#28-anchors) + - [Caret ^](#281-caret) + - [Dollar $](#282-dollar) +- [Kurzschreibweisen](#3-shorthand-character-sets) +- [Umschauen](#4-lookaround) + - [Positives Vorrausschauen](#41-positive-lookahead) + - [Negatives Vorrausschauen](#42-negative-lookahead) + - [Positives Zurückschauen](#43-positive-lookbehind) + - [Negatives Zurückschauen](#44-negative-lookbehind) +- [Steuerparameter](#5-flags) + - [Groß-/kleinschreibung](#51-case-insensitive) + - [Globale Suche](#52-global-search) + - [Mehrzeilig](#53-multiline) +- [Gierige oder faule Übereinstimmung](#6-greedy-vs-lazy-matching) + +## 1. Basis Vergleiche + +A regular expression is just a pattern of characters that we use to perform +search in a text. For example, the regular expression `the` means: the letter +`t`, followed by the letter `h`, followed by the letter `e`. + +
+"the" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/dmRygT/1) + +The regular expression `123` matches the string `123`. The regular expression is +matched against an input string by comparing each character in the regular +expression to each character in the input string, one after another. Regular +expressions are normally case-sensitive so the regular expression `The` would +not match the string `the`. + +
+"The" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/1paXsy/1) + +## 2. Meta Characters + +Meta characters are the building blocks of the regular expressions. Meta +characters do not stand for themselves but instead are interpreted in some +special way. Some meta characters have a special meaning and are written inside +square brackets. The meta characters are as follows: + +|Meta character|Description| +|:----:|----| +|.|Period matches any single character except a line break.| +|[ ]|Character class. Matches any character contained between the square brackets.| +|[^ ]|Negated character class. Matches any character that is not contained between the square brackets| +|*|Matches 0 or more repetitions of the preceding symbol.| +|+|Matches 1 or more repetitions of the preceding symbol.| +|?|Makes the preceding symbol optional.| +|{n,m}|Braces. Matches at least "n" but not more than "m" repetitions of the preceding symbol.| +|(xyz)|Character group. Matches the characters xyz in that exact order.| +|||Alternation. Matches either the characters before or the characters after the symbol.| +|\|Escapes the next character. This allows you to match reserved characters [ ] ( ) { } . * + ? ^ $ \ || +|^|Matches the beginning of the input.| +|$|Matches the end of the input.| + +## 2.1 Full stop + +Full stop `.` is the simplest example of meta character. The meta character `.` +matches any single character. It will not match return or newline characters. +For example, the regular expression `.ar` means: any character, followed by the +letter `a`, followed by the letter `r`. + +
+".ar" => The car parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/xc9GkU/1) + +## 2.2 Character set + +Character sets are also called character class. Square brackets are used to +specify character sets. Use a hyphen inside a character set to specify the +characters' range. The order of the character range inside square brackets +doesn't matter. For example, the regular expression `[Tt]he` means: an uppercase +`T` or lowercase `t`, followed by the letter `h`, followed by the letter `e`. + +
+"[Tt]he" => The car parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/2ITLQ4/1) + +A period inside a character set, however, means a literal period. The regular +expression `ar[.]` means: a lowercase character `a`, followed by letter `r`, +followed by a period `.` character. + +
+"ar[.]" => A garage is a good place to park a car.
+
+ +[Test the regular expression](https://regex101.com/r/wL3xtE/1) + +### 2.2.1 Negated character set + +In general, the caret symbol represents the start of the string, but when it is +typed after the opening square bracket it negates the character set. For +example, the regular expression `[^c]ar` means: any character except `c`, +followed by the character `a`, followed by the letter `r`. + +
+"[^c]ar" => The car parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/nNNlq3/1) + +## 2.3 Repetitions + +Following meta characters `+`, `*` or `?` are used to specify how many times a +subpattern can occur. These meta characters act differently in different +situations. + +### 2.3.1 The Star + +The symbol `*` matches zero or more repetitions of the preceding matcher. The +regular expression `a*` means: zero or more repetitions of preceding lowercase +character `a`. But if it appears after a character set or class then it finds +the repetitions of the whole character set. For example, the regular expression +`[a-z]*` means: any number of lowercase letters in a row. + +
+"[a-z]*" => The car parked in the garage #21.
+
+ +[Test the regular expression](https://regex101.com/r/7m8me5/1) + +The `*` symbol can be used with the meta character `.` to match any string of +characters `.*`. The `*` symbol can be used with the whitespace character `\s` +to match a string of whitespace characters. For example, the expression +`\s*cat\s*` means: zero or more spaces, followed by lowercase character `c`, +followed by lowercase character `a`, followed by lowercase character `t`, +followed by zero or more spaces. + +
+"\s*cat\s*" => The fat cat sat on the concatenation.
+
+ +[Test the regular expression](https://regex101.com/r/gGrwuz/1) + +### 2.3.2 The Plus + +The symbol `+` matches one or more repetitions of the preceding character. For +example, the regular expression `c.+t` means: lowercase letter `c`, followed by +at least one character, followed by the lowercase character `t`. It needs to be +clarified that `t` is the last `t` in the sentence. + +
+"c.+t" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/Dzf9Aa/1) + +### 2.3.3 The Question Mark + +In regular expression the meta character `?` makes the preceding character +optional. This symbol matches zero or one instance of the preceding character. +For example, the regular expression `[T]?he` means: Optional the uppercase +letter `T`, followed by the lowercase character `h`, followed by the lowercase +character `e`. + +
+"[T]he" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/cIg9zm/1) + +
+"[T]?he" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/kPpO2x/1) + +## 2.4 Braces + +In regular expression braces that are also called quantifiers are used to +specify the number of times that a character or a group of characters can be +repeated. For example, the regular expression `[0-9]{2,3}` means: Match at least +2 digits but not more than 3 ( characters in the range of 0 to 9). + +
+"[0-9]{2,3}" => The number was 9.9997 but we rounded it off to 10.0.
+
+ +[Test the regular expression](https://regex101.com/r/juM86s/1) + +We can leave out the second number. For example, the regular expression +`[0-9]{2,}` means: Match 2 or more digits. If we also remove the comma the +regular expression `[0-9]{3}` means: Match exactly 3 digits. + +
+"[0-9]{2,}" => The number was 9.9997 but we rounded it off to 10.0.
+
+ +[Test the regular expression](https://regex101.com/r/Gdy4w5/1) + +
+"[0-9]{3}" => The number was 9.9997 but we rounded it off to 10.0.
+
+ +[Test the regular expression](https://regex101.com/r/Sivu30/1) + +## 2.5 Capturing Group + +A capturing group is a group of sub-patterns that is written inside Parentheses +`(...)`. Like as we discussed before that in regular expression if we put a quantifier +after a character then it will repeat the preceding character. But if we put quantifier +after a capturing group then it repeats the whole capturing group. For example, +the regular expression `(ab)*` matches zero or more repetitions of the character +"ab". We can also use the alternation `|` meta character inside capturing group. +For example, the regular expression `(c|g|p)ar` means: lowercase character `c`, +`g` or `p`, followed by character `a`, followed by character `r`. + +
+"(c|g|p)ar" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/tUxrBG/1) + +Note that capturing groups do not only match but also capture the characters for use in +the parent language. The parent language could be python or javascript or virtually any +language that implements regular expressions in a function definition. + +### 2.5.1 Non-capturing group + +A non-capturing group is a capturing group that only matches the characters, but +does not capture the group. A non-capturing group is denoted by a `?` followed by a `:` +within parenthesis `(...)`. For example, the regular expression `(?:c|g|p)ar` is similar to +`(c|g|p)ar` in that it matches the same characters but will not create a capture group. + +
+"(?:c|g|p)ar" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/Rm7Me8/1) + +Non-capturing groups can come in handy when used in find-and-replace functionality or +when mixed with capturing groups to keep the overview when producing any other kind of output. +See also [4. Lookaround](#4-lookaround). + +## 2.6 Alternation + +In a regular expression, the vertical bar `|` is used to define alternation. +Alternation is like an OR statement between multiple expressions. Now, you may be +thinking that character set and alternation works the same way. But the big +difference between character set and alternation is that character set works on +character level but alternation works on expression level. For example, the +regular expression `(T|t)he|car` means: either (uppercase character `T` or lowercase +`t`, followed by lowercase character `h`, followed by lowercase character `e`) OR +(lowercase character `c`, followed by lowercase character `a`, followed by +lowercase character `r`). Note that I put the parentheses for clarity, to show that either expression +in parentheses can be met and it will match. + +
+"(T|t)he|car" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/fBXyX0/1) + +## 2.7 Escaping special character + +Backslash `\` is used in regular expression to escape the next character. This +allows us to specify a symbol as a matching character including reserved +characters `{ } [ ] / \ + * . $ ^ | ?`. To use a special character as a matching +character prepend `\` before it. + +For example, the regular expression `.` is used to match any character except +newline. Now to match `.` in an input string the regular expression +`(f|c|m)at\.?` means: lowercase letter `f`, `c` or `m`, followed by lowercase +character `a`, followed by lowercase letter `t`, followed by optional `.` +character. + +
+"(f|c|m)at\.?" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/DOc5Nu/1) + +## 2.8 Anchors + +In regular expressions, we use anchors to check if the matching symbol is the +starting symbol or ending symbol of the input string. Anchors are of two types: +First type is Caret `^` that check if the matching character is the start +character of the input and the second type is Dollar `$` that checks if matching +character is the last character of the input string. + +### 2.8.1 Caret + +Caret `^` symbol is used to check if matching character is the first character +of the input string. If we apply the following regular expression `^a` (if a is +the starting symbol) to input string `abc` it matches `a`. But if we apply +regular expression `^b` on above input string it does not match anything. +Because in input string `abc` "b" is not the starting symbol. Let's take a look +at another regular expression `^(T|t)he` which means: uppercase character `T` or +lowercase character `t` is the start symbol of the input string, followed by +lowercase character `h`, followed by lowercase character `e`. + +
+"(T|t)he" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/5ljjgB/1) + +
+"^(T|t)he" => The car is parked in the garage.
+
+ +[Test the regular expression](https://regex101.com/r/jXrKne/1) + +### 2.8.2 Dollar + +Dollar `$` symbol is used to check if matching character is the last character +of the input string. For example, regular expression `(at\.)$` means: a +lowercase character `a`, followed by lowercase character `t`, followed by a `.` +character and the matcher must be end of the string. + +
+"(at\.)" => The fat cat. sat. on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/y4Au4D/1) + +
+"(at\.)$" => The fat cat. sat. on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/t0AkOd/1) + +## 3. Shorthand Character Sets + +Regular expression provides shorthands for the commonly used character sets, +which offer convenient shorthands for commonly used regular expressions. The +shorthand character sets are as follows: + +|Shorthand|Description| +|:----:|----| +|.|Any character except new line| +|\w|Matches alphanumeric characters: `[a-zA-Z0-9_]`| +|\W|Matches non-alphanumeric characters: `[^\w]`| +|\d|Matches digit: `[0-9]`| +|\D|Matches non-digit: `[^\d]`| +|\s|Matches whitespace character: `[\t\n\f\r\p{Z}]`| +|\S|Matches non-whitespace character: `[^\s]`| + +## 4. Lookaround + +Lookbehind and lookahead (also called lookaround) are specific types of +***non-capturing groups*** (Used to match the pattern but not included in matching +list). Lookarounds are used when we have the condition that this pattern is +preceded or followed by another certain pattern. For example, we want to get all +numbers that are preceded by `$` character from the following input string +`$4.44 and $10.88`. We will use following regular expression `(?<=\$)[0-9\.]*` +which means: get all the numbers which contain `.` character and are preceded +by `$` character. Following are the lookarounds that are used in regular +expressions: + +|Symbol|Description| +|:----:|----| +|?=|Positive Lookahead| +|?!|Negative Lookahead| +|?<=|Positive Lookbehind| +|? +"(T|t)he(?=\sfat)" => The fat cat sat on the mat. + + +[Test the regular expression](https://regex101.com/r/IDDARt/1) + +### 4.2 Negative Lookahead + +Negative lookahead is used when we need to get all matches from input string +that are not followed by a pattern. Negative lookahead is defined same as we define +positive lookahead but the only difference is instead of equal `=` character we +use negation `!` character i.e. `(?!...)`. Let's take a look at the following +regular expression `(T|t)he(?!\sfat)` which means: get all `The` or `the` words +from input string that are not followed by the word `fat` precedes by a space +character. + +
+"(T|t)he(?!\sfat)" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/V32Npg/1) + +### 4.3 Positive Lookbehind + +Positive lookbehind is used to get all the matches that are preceded by a +specific pattern. Positive lookbehind is denoted by `(?<=...)`. For example, the +regular expression `(?<=(T|t)he\s)(fat|mat)` means: get all `fat` or `mat` words +from input string that are after the word `The` or `the`. + +
+"(?<=(T|t)he\s)(fat|mat)" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/avH165/1) + +### 4.4 Negative Lookbehind + +Negative lookbehind is used to get all the matches that are not preceded by a +specific pattern. Negative lookbehind is denoted by `(? +"(?<!(T|t)he\s)(cat)" => The cat sat on cat. + + +[Test the regular expression](https://regex101.com/r/8Efx5G/1) + +## 5. Flags + +Flags are also called modifiers because they modify the output of a regular +expression. These flags can be used in any order or combination, and are an +integral part of the RegExp. + +|Flag|Description| +|:----:|----| +|i|Case insensitive: Sets matching to be case-insensitive.| +|g|Global Search: Search for a pattern throughout the input string.| +|m|Multiline: Anchor meta character works on each line.| + +### 5.1 Case Insensitive + +The `i` modifier is used to perform case-insensitive matching. For example, the +regular expression `/The/gi` means: uppercase letter `T`, followed by lowercase +character `h`, followed by character `e`. And at the end of regular expression +the `i` flag tells the regular expression engine to ignore the case. As you can +see we also provided `g` flag because we want to search for the pattern in the +whole input string. + +
+"The" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/dpQyf9/1) + +
+"/The/gi" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/ahfiuh/1) + +### 5.2 Global search + +The `g` modifier is used to perform a global match (find all matches rather than +stopping after the first match). For example, the regular expression`/.(at)/g` +means: any character except new line, followed by lowercase character `a`, +followed by lowercase character `t`. Because we provided `g` flag at the end of +the regular expression now it will find all matches in the input string, not just the first one (which is the default behavior). + +
+"/.(at)/" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/jnk6gM/1) + +
+"/.(at)/g" => The fat cat sat on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/dO1nef/1) + +### 5.3 Multiline + +The `m` modifier is used to perform a multi-line match. As we discussed earlier +anchors `(^, $)` are used to check if pattern is the beginning of the input or +end of the input string. But if we want that anchors works on each line we use +`m` flag. For example, the regular expression `/at(.)?$/gm` means: lowercase +character `a`, followed by lowercase character `t`, optionally anything except +new line. And because of `m` flag now regular expression engine matches pattern +at the end of each line in a string. + +
+"/.at(.)?$/" => The fat
+                cat sat
+                on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/hoGMkP/1) + +
+"/.at(.)?$/gm" => The fat
+                  cat sat
+                  on the mat.
+
+ +[Test the regular expression](https://regex101.com/r/E88WE2/1) + +## 6. Greedy vs lazy matching +By default regex will do greedy matching , means it will match as long as +possible. we can use `?` to match in lazy way means as short as possible + +
+"/(.*at)/" => The fat cat sat on the mat. 
+ + +[Test the regular expression](https://regex101.com/r/AyAdgJ/1) + +
+"/(.*?at)/" => The fat cat sat on the mat. 
+ + +[Test the regular expression](https://regex101.com/r/AyAdgJ/2) + + +## Contribution + +* Open pull request with improvements +* Discuss ideas in issues +* Spread the word +* Reach out with any feedback [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/ziishaned.svg?style=social&label=Follow%20%40ziishaned)](https://twitter.com/ziishaned) + +## License + +MIT © [Zeeshan Ahmad](https://twitter.com/ziishaned) From e3a1744640c2eef8c4e3d3606c33f6a883366eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20B=C3=BCltge?= Date: Thu, 29 Aug 2019 12:21:24 +0200 Subject: [PATCH 02/16] Update path to self file and image --- translations/README-de.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translations/README-de.md b/translations/README-de.md index f4e7e14..b503af4 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -8,7 +8,7 @@ ## Translations: * [English](../README.md) -* [German](../translations/Readme-de.md) +* [German](Readme-de.md) * [Español](../translations/README-es.md) * [Français](../translations/README-fr.md) * [Português do Brasil](../translations/README-pt_BR.md) @@ -36,7 +36,7 @@ wir die Anzahl der Zeichen limitieren, damit der Name nicht unlesbar wird. Dazu den Benutzernamen zu überprüfen:

- Regular expression + Regular expression

Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, `jo-hn_doe` und `john12_as`. Der Eingabe `Jo` wird From b0f6cf611b805fed710edc270d126cec7e7d098e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20B=C3=BCltge?= Date: Thu, 29 Aug 2019 12:22:19 +0200 Subject: [PATCH 03/16] Remove Link we are on the file --- translations/README-de.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/README-de.md b/translations/README-de.md index b503af4..22463f6 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -8,7 +8,7 @@ ## Translations: * [English](../README.md) -* [German](Readme-de.md) +* German * [Español](../translations/README-es.md) * [Français](../translations/README-fr.md) * [Português do Brasil](../translations/README-pt_BR.md) From 21cf6aefe58165b14079ccedaf8714af6b02b6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20B=C3=BCltge?= Date: Thu, 29 Aug 2019 12:23:14 +0200 Subject: [PATCH 04/16] Add link to German translation. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3a5c055..63c8a7e 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ ## Translations: * [English](README.md) +* [German](translations/README-de.md) * [Español](translations/README-es.md) * [Français](translations/README-fr.md) * [Português do Brasil](translations/README-pt_BR.md) From 81660715a4cb5ffb2a1de8b953b800f735d877e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20B=C3=BCltge?= Date: Thu, 29 Aug 2019 15:01:28 +0200 Subject: [PATCH 05/16] Add more translations --- translations/README-de.md | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/translations/README-de.md b/translations/README-de.md index 22463f6..ff2ebd4 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -39,8 +39,7 @@ den Benutzernamen zu überprüfen: Regular expression

-Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, `jo-hn_doe` und `john12_as`. Der Eingabe `Jo` wird -nicht akzeptiert, da sie einen Großbuchstaben enthält und zu kurz ist. +Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, `jo-hn_doe` und `john12_as`. Der Eingabe `Jo` wird nicht akzeptiert, da sie einen Großbuchstaben enthält und zu kurz ist. ## Table of Contents @@ -53,9 +52,9 @@ nicht akzeptiert, da sie einen Großbuchstaben enthält und zu kurz ist. - [Stern *](#231-the-star) - [Plus +](#232-the-plus) - [Fragezeichen ?](#233-the-question-mark) - - [Klammern](#24-braces) + - [Klammern {}](#24-braces) - [Zeichengruppen](#25-character-group) - - [Alternation](#26-alternation) + - [Alternation |](#26-alternation) - [Auswertung von Sonderzeichen](#27-escaping-special-character) - [Anker](#28-anchors) - [Caret ^](#281-caret) @@ -67,43 +66,34 @@ nicht akzeptiert, da sie einen Großbuchstaben enthält und zu kurz ist. - [Positives Zurückschauen](#43-positive-lookbehind) - [Negatives Zurückschauen](#44-negative-lookbehind) - [Steuerparameter](#5-flags) - - [Groß-/kleinschreibung](#51-case-insensitive) + - [Groß-/Kleinschreibung](#51-case-insensitive) - [Globale Suche](#52-global-search) - [Mehrzeilig](#53-multiline) - [Gierige oder faule Übereinstimmung](#6-greedy-vs-lazy-matching) ## 1. Basis Vergleiche -A regular expression is just a pattern of characters that we use to perform -search in a text. For example, the regular expression `the` means: the letter -`t`, followed by the letter `h`, followed by the letter `e`. +Ein regulärer Ausdruck ist ein einfaches Muster von Zeichen, welches für eine Suche in Text genutzt wird. Zum Beispiel, der reguläre Ausdruck `the` meint: der Buchstabe `t`, gefolgt durch den Buchstaben `h`, gefolgt durch den Buchstaben `e`.
 "the" => The fat cat sat on the mat.
 
-[Test the regular expression](https://regex101.com/r/dmRygT/1) +[Teste den regulären Ausdruck](https://regex101.com/r/dmRygT/1) -The regular expression `123` matches the string `123`. The regular expression is -matched against an input string by comparing each character in the regular -expression to each character in the input string, one after another. Regular -expressions are normally case-sensitive so the regular expression `The` would -not match the string `the`. +Der reguläre Ausdruck `123` entspricht der Zeichenkette `123`. Dieser reguläre Ausdruck kann mit einer Zeichenkette verglichen werden, in dem jedes Zeichen in dem regulären Ausdruck nacheinander verglichen wird. Reguläre Ausdrücke sind normalerweise case sensitiv, Beachtung von Groß-/Kleinschreibung, so dass der Ausdruck `The` nicht mit der Zeichenkette `the` überein stimmen würde.
 "The" => The fat cat sat on the mat.
 
-[Test the regular expression](https://regex101.com/r/1paXsy/1) +[Teste den regulären Ausdruck](https://regex101.com/r/1paXsy/1) -## 2. Meta Characters +## 2. Sonderzeichen -Meta characters are the building blocks of the regular expressions. Meta -characters do not stand for themselves but instead are interpreted in some -special way. Some meta characters have a special meaning and are written inside -square brackets. The meta characters are as follows: +Sonderzeichen sind Bausteine von regulären Ausdrücken. Sonderzeichen stehen nicht für sich selbst, sondern werden in speziellen Fällen interpretiert. Einige Sonderzeichen haben eine besondere Bedeutung und sind innerhalb eckiger Klammern `[]`. Folgende Sonderzeichen sind möglich: -|Meta character|Description| +|Sonderzeichen|Beschreibung| |:----:|----| |.|Period matches any single character except a line break.| |[ ]|Character class. Matches any character contained between the square brackets.| From 26a9e2d94e4cae467884bbe14455d110ae981d79 Mon Sep 17 00:00:00 2001 From: Bueltge Date: Thu, 19 Mar 2020 14:54:57 +0100 Subject: [PATCH 06/16] Update my current status --- translations/README-de.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translations/README-de.md b/translations/README-de.md index ff2ebd4..bbb2c4d 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -95,23 +95,23 @@ Sonderzeichen sind Bausteine von regulären Ausdrücken. Sonderzeichen stehen ni |Sonderzeichen|Beschreibung| |:----:|----| -|.|Period matches any single character except a line break.| -|[ ]|Character class. Matches any character contained between the square brackets.| -|[^ ]|Negated character class. Matches any character that is not contained between the square brackets| -|*|Matches 0 or more repetitions of the preceding symbol.| -|+|Matches 1 or more repetitions of the preceding symbol.| -|?|Makes the preceding symbol optional.| -|{n,m}|Braces. Matches at least "n" but not more than "m" repetitions of the preceding symbol.| -|(xyz)|Character group. Matches the characters xyz in that exact order.| -|||Alternation. Matches either the characters before or the characters after the symbol.| -|\|Escapes the next character. This allows you to match reserved characters [ ] ( ) { } . * + ? ^ $ \ || -|^|Matches the beginning of the input.| -|$|Matches the end of the input.| +|.|Der Punkt entspricht jedem einzelnen Zeichen, außer einem Zeilenumbruch.| +|[ ]|Zeichen-Klasse, entspricht jedem Zeichen innerhalb der eckigen Klammern.| +|[^ ]|Negierte Zeichen-Klasse, entspricht jedem Zeichen welches nicht innerhalb der eckigen Klammern definiert ist.| +|*|Entspricht 0 oder mehr Wiederholungen der voran gestellten Zeichen.| +|+|Entspricht 1 oder mehr Wiederholungen der voran gestellten Zeichen.| +|?|Macht das vorhergehende Zeichen optional.| +|{n,m}|Klammern, entspricht mindestens "n", aber nicht mehr als "m" Wiederholungen des Zeichens.| +|(xyz)|Zeichengruppe, entspricht den Zeichen xyz in der exakten Reihenfolge.| +|||Alternation, entspricht entweder den Zeichen vor oder nach dem Sonderzeichen \|.| +|\|Entfernt das nachfolgende Zeichen. Dies ermöglicht es Zeichen zu blockieren [ ] ( ) { } . * + ? ^ $ \ || +|^|Überprüft den Anfang einer Eingabe.| +|$|Überprüft das Ende einer Eingabe.| -## 2.1 Full stop +## 2.1 Punkt -Full stop `.` is the simplest example of meta character. The meta character `.` -matches any single character. It will not match return or newline characters. +Der Punkt `.` ist die einfachste Möglichkeit von Sonderzeichen. Das Sonderzeichen `.` + entspricht jedem einzelnen Zeichen. It will not match return or newline characters. For example, the regular expression `.ar` means: any character, followed by the letter `a`, followed by the letter `r`. From b617729b2575ab3a30a2d01cac3697620cab1ac3 Mon Sep 17 00:00:00 2001 From: Frank Bueltge Date: Mon, 20 Apr 2020 15:26:55 +0200 Subject: [PATCH 07/16] Update chanpte 2 --- translations/README-de.md | 112 ++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 60 deletions(-) diff --git a/translations/README-de.md b/translations/README-de.md index bbb2c4d..b8b0946 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -46,7 +46,7 @@ Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, ` - [Basis Vergleiche](#1-basic-matchers) - [Sonderzeichen](#2-meta-characters) - [Punkt](#21-full-stop) - - [Character set](#22-character-set) + - [Zeichensätze](#22-zeichensaetze) - [Invertierter Zeichensatz](#221-negated-character-set) - [Wiederholungen](#23-repetitions) - [Stern *](#231-the-star) @@ -111,29 +111,21 @@ Sonderzeichen sind Bausteine von regulären Ausdrücken. Sonderzeichen stehen ni ## 2.1 Punkt Der Punkt `.` ist die einfachste Möglichkeit von Sonderzeichen. Das Sonderzeichen `.` - entspricht jedem einzelnen Zeichen. It will not match return or newline characters. -For example, the regular expression `.ar` means: any character, followed by the -letter `a`, followed by the letter `r`. + entspricht jedem einzelnen Zeichen. Es wird kein Zeilenumbruch oder Enter-Zeichen gefunden. Als Beispiel, der reguläre Ausdruck `.ar` bedeutet: ein beliebiges Zeichen, gefolgt von dem Buchstaben `a`, gefolgt vom Buchstaben `r`.
 ".ar" => The car parked in the garage.
 
+[Teste den regulären Ausdruck](https://regex101.com/r/xc9GkU/1) -[Test the regular expression](https://regex101.com/r/xc9GkU/1) +## 2.2 Zeichensätze -## 2.2 Character set - -Character sets are also called character class. Square brackets are used to -specify character sets. Use a hyphen inside a character set to specify the -characters' range. The order of the character range inside square brackets -doesn't matter. For example, the regular expression `[Tt]he` means: an uppercase -`T` or lowercase `t`, followed by the letter `h`, followed by the letter `e`. +Zeichensätze werden auch als Zeichenklasse bezeichnet. Zeichensätze werden in eckige Klammern angegeben. Um den Bereich der Zeichen anzugeben ist ein Bindestrich zu verwenden. Die Reihenfolge des Bereiches in den eckigen Klammern spielt keine Rolle. Zum Beispiel bedeutet der reguläre Ausdruck `[Tt]he`: ein groß geschriebenes `T` oder ein kleingeschriebenes `t`, gefolgt vom Buchstaben `h` und weiter gefolgt vom Buchstaben `e`.
 "[Tt]he" => The car parked in the garage.
 
- -[Test the regular expression](https://regex101.com/r/2ITLQ4/1) +[Teste den regulären Ausdruck](https://regex101.com/r/2ITLQ4/1) A period inside a character set, however, means a literal period. The regular expression `ar[.]` means: a lowercase character `a`, followed by letter `r`, @@ -143,20 +135,20 @@ followed by a period `.` character. "ar[.]" => A garage is a good place to park a car. -[Test the regular expression](https://regex101.com/r/wL3xtE/1) +[Teste den regulären Ausdruck](https://regex101.com/r/wL3xtE/1) ### 2.2.1 Negated character set In general, the caret symbol represents the start of the string, but when it is typed after the opening square bracket it negates the character set. For -example, the regular expression `[^c]ar` means: any character except `c`, +example, der reguläre Ausdruck `[^c]ar` means: any character except `c`, followed by the character `a`, followed by the letter `r`.
 "[^c]ar" => The car parked in the garage.
 
-[Test the regular expression](https://regex101.com/r/nNNlq3/1) +[Teste den regulären Ausdruck](https://regex101.com/r/nNNlq3/1) ## 2.3 Repetitions @@ -169,14 +161,14 @@ situations. The symbol `*` matches zero or more repetitions of the preceding matcher. The regular expression `a*` means: zero or more repetitions of preceding lowercase character `a`. But if it appears after a character set or class then it finds -the repetitions of the whole character set. For example, the regular expression +the repetitions of the whole character set. For example, der reguläre Ausdruck `[a-z]*` means: any number of lowercase letters in a row.
 "[a-z]*" => The car parked in the garage #21.
 
-[Test the regular expression](https://regex101.com/r/7m8me5/1) +[Teste den regulären Ausdruck](https://regex101.com/r/7m8me5/1) The `*` symbol can be used with the meta character `.` to match any string of characters `.*`. The `*` symbol can be used with the whitespace character `\s` @@ -189,12 +181,12 @@ followed by zero or more spaces. "\s*cat\s*" => The fat cat sat on the concatenation. -[Test the regular expression](https://regex101.com/r/gGrwuz/1) +[Teste den regulären Ausdruck](https://regex101.com/r/gGrwuz/1) ### 2.3.2 The Plus The symbol `+` matches one or more repetitions of the preceding character. For -example, the regular expression `c.+t` means: lowercase letter `c`, followed by +example, der reguläre Ausdruck `c.+t` means: lowercase letter `c`, followed by at least one character, followed by the lowercase character `t`. It needs to be clarified that `t` is the last `t` in the sentence. @@ -202,13 +194,13 @@ clarified that `t` is the last `t` in the sentence. "c.+t" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/Dzf9Aa/1) +[Teste den regulären Ausdruck](https://regex101.com/r/Dzf9Aa/1) ### 2.3.3 The Question Mark In regular expression the meta character `?` makes the preceding character optional. This symbol matches zero or one instance of the preceding character. -For example, the regular expression `[T]?he` means: Optional the uppercase +For example, der reguläre Ausdruck `[T]?he` means: Optional the uppercase letter `T`, followed by the lowercase character `h`, followed by the lowercase character `e`. @@ -216,28 +208,28 @@ character `e`. "[T]he" => The car is parked in the garage. -[Test the regular expression](https://regex101.com/r/cIg9zm/1) +[Teste den regulären Ausdruck](https://regex101.com/r/cIg9zm/1)
 "[T]?he" => The car is parked in the garage.
 
-[Test the regular expression](https://regex101.com/r/kPpO2x/1) +[Teste den regulären Ausdruck](https://regex101.com/r/kPpO2x/1) ## 2.4 Braces In regular expression braces that are also called quantifiers are used to specify the number of times that a character or a group of characters can be -repeated. For example, the regular expression `[0-9]{2,3}` means: Match at least +repeated. For example, der reguläre Ausdruck `[0-9]{2,3}` means: Match at least 2 digits but not more than 3 ( characters in the range of 0 to 9).
 "[0-9]{2,3}" => The number was 9.9997 but we rounded it off to 10.0.
 
-[Test the regular expression](https://regex101.com/r/juM86s/1) +[Teste den regulären Ausdruck](https://regex101.com/r/juM86s/1) -We can leave out the second number. For example, the regular expression +We can leave out the second number. For example, der reguläre Ausdruck `[0-9]{2,}` means: Match 2 or more digits. If we also remove the comma the regular expression `[0-9]{3}` means: Match exactly 3 digits. @@ -245,13 +237,13 @@ regular expression `[0-9]{3}` means: Match exactly 3 digits. "[0-9]{2,}" => The number was 9.9997 but we rounded it off to 10.0. -[Test the regular expression](https://regex101.com/r/Gdy4w5/1) +[Teste den regulären Ausdruck](https://regex101.com/r/Gdy4w5/1)
 "[0-9]{3}" => The number was 9.9997 but we rounded it off to 10.0.
 
-[Test the regular expression](https://regex101.com/r/Sivu30/1) +[Teste den regulären Ausdruck](https://regex101.com/r/Sivu30/1) ## 2.5 Capturing Group @@ -259,16 +251,16 @@ A capturing group is a group of sub-patterns that is written inside Parentheses `(...)`. Like as we discussed before that in regular expression if we put a quantifier after a character then it will repeat the preceding character. But if we put quantifier after a capturing group then it repeats the whole capturing group. For example, -the regular expression `(ab)*` matches zero or more repetitions of the character +der reguläre Ausdruck `(ab)*` matches zero or more repetitions of the character "ab". We can also use the alternation `|` meta character inside capturing group. -For example, the regular expression `(c|g|p)ar` means: lowercase character `c`, +For example, der reguläre Ausdruck `(c|g|p)ar` means: lowercase character `c`, `g` or `p`, followed by character `a`, followed by character `r`.
 "(c|g|p)ar" => The car is parked in the garage.
 
-[Test the regular expression](https://regex101.com/r/tUxrBG/1) +[Teste den regulären Ausdruck](https://regex101.com/r/tUxrBG/1) Note that capturing groups do not only match but also capture the characters for use in the parent language. The parent language could be python or javascript or virtually any @@ -278,14 +270,14 @@ language that implements regular expressions in a function definition. A non-capturing group is a capturing group that only matches the characters, but does not capture the group. A non-capturing group is denoted by a `?` followed by a `:` -within parenthesis `(...)`. For example, the regular expression `(?:c|g|p)ar` is similar to +within parenthesis `(...)`. For example, der reguläre Ausdruck `(?:c|g|p)ar` is similar to `(c|g|p)ar` in that it matches the same characters but will not create a capture group.
 "(?:c|g|p)ar" => The car is parked in the garage.
 
-[Test the regular expression](https://regex101.com/r/Rm7Me8/1) +[Teste den regulären Ausdruck](https://regex101.com/r/Rm7Me8/1) Non-capturing groups can come in handy when used in find-and-replace functionality or when mixed with capturing groups to keep the overview when producing any other kind of output. @@ -308,7 +300,7 @@ in parentheses can be met and it will match. "(T|t)he|car" => The car is parked in the garage. -[Test the regular expression](https://regex101.com/r/fBXyX0/1) +[Teste den regulären Ausdruck](https://regex101.com/r/fBXyX0/1) ## 2.7 Escaping special character @@ -317,8 +309,8 @@ allows us to specify a symbol as a matching character including reserved characters `{ } [ ] / \ + * . $ ^ | ?`. To use a special character as a matching character prepend `\` before it. -For example, the regular expression `.` is used to match any character except -newline. Now to match `.` in an input string the regular expression +For example, der reguläre Ausdruck `.` is used to match any character except +newline. Now to match `.` in an input string der reguläre Ausdruck `(f|c|m)at\.?` means: lowercase letter `f`, `c` or `m`, followed by lowercase character `a`, followed by lowercase letter `t`, followed by optional `.` character. @@ -327,7 +319,7 @@ character. "(f|c|m)at\.?" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/DOc5Nu/1) +[Teste den regulären Ausdruck](https://regex101.com/r/DOc5Nu/1) ## 2.8 Anchors @@ -352,13 +344,13 @@ lowercase character `h`, followed by lowercase character `e`. "(T|t)he" => The car is parked in the garage. -[Test the regular expression](https://regex101.com/r/5ljjgB/1) +[Teste den regulären Ausdruck](https://regex101.com/r/5ljjgB/1)
 "^(T|t)he" => The car is parked in the garage.
 
-[Test the regular expression](https://regex101.com/r/jXrKne/1) +[Teste den regulären Ausdruck](https://regex101.com/r/jXrKne/1) ### 2.8.2 Dollar @@ -371,13 +363,13 @@ character and the matcher must be end of the string. "(at\.)" => The fat cat. sat. on the mat. -[Test the regular expression](https://regex101.com/r/y4Au4D/1) +[Teste den regulären Ausdruck](https://regex101.com/r/y4Au4D/1)
 "(at\.)$" => The fat cat. sat. on the mat.
 
-[Test the regular expression](https://regex101.com/r/t0AkOd/1) +[Teste den regulären Ausdruck](https://regex101.com/r/t0AkOd/1) ## 3. Shorthand Character Sets @@ -421,7 +413,7 @@ followed by the lookahead expression. The returned match only contains the text that is matched by the first part of the expression. To define a positive lookahead, parentheses are used. Within those parentheses, a question mark with equal sign is used like this: `(?=...)`. Lookahead expression is written after -the equal sign inside parentheses. For example, the regular expression +the equal sign inside parentheses. For example, der reguläre Ausdruck `(T|t)he(?=\sfat)` means: optionally match lowercase letter `t` or uppercase letter `T`, followed by letter `h`, followed by letter `e`. In parentheses we define positive lookahead which tells regular expression engine to match `The` @@ -431,7 +423,7 @@ or `the` which are followed by the word `fat`. "(T|t)he(?=\sfat)" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/IDDARt/1) +[Teste den regulären Ausdruck](https://regex101.com/r/IDDARt/1) ### 4.2 Negative Lookahead @@ -447,7 +439,7 @@ character. "(T|t)he(?!\sfat)" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/V32Npg/1) +[Teste den regulären Ausdruck](https://regex101.com/r/V32Npg/1) ### 4.3 Positive Lookbehind @@ -460,7 +452,7 @@ from input string that are after the word `The` or `the`. "(?<=(T|t)he\s)(fat|mat)" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/avH165/1) +[Teste den regulären Ausdruck](https://regex101.com/r/avH165/1) ### 4.4 Negative Lookbehind @@ -473,7 +465,7 @@ string that are not after the word `The` or `the`. "(?<!(T|t)he\s)(cat)" => The cat sat on cat. -[Test the regular expression](https://regex101.com/r/8Efx5G/1) +[Teste den regulären Ausdruck](https://regex101.com/r/8Efx5G/1) ## 5. Flags @@ -492,7 +484,7 @@ integral part of the RegExp. The `i` modifier is used to perform case-insensitive matching. For example, the regular expression `/The/gi` means: uppercase letter `T`, followed by lowercase character `h`, followed by character `e`. And at the end of regular expression -the `i` flag tells the regular expression engine to ignore the case. As you can +the `i` flag tells der reguläre Ausdruck engine to ignore the case. As you can see we also provided `g` flag because we want to search for the pattern in the whole input string. @@ -500,40 +492,40 @@ whole input string. "The" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/dpQyf9/1) +[Teste den regulären Ausdruck](https://regex101.com/r/dpQyf9/1)
 "/The/gi" => The fat cat sat on the mat.
 
-[Test the regular expression](https://regex101.com/r/ahfiuh/1) +[Teste den regulären Ausdruck](https://regex101.com/r/ahfiuh/1) ### 5.2 Global search The `g` modifier is used to perform a global match (find all matches rather than -stopping after the first match). For example, the regular expression`/.(at)/g` +stopping after the first match). For example, der reguläre Ausdruck`/.(at)/g` means: any character except new line, followed by lowercase character `a`, followed by lowercase character `t`. Because we provided `g` flag at the end of -the regular expression now it will find all matches in the input string, not just the first one (which is the default behavior). +der reguläre Ausdruck now it will find all matches in the input string, not just the first one (which is the default behavior).
 "/.(at)/" => The fat cat sat on the mat.
 
-[Test the regular expression](https://regex101.com/r/jnk6gM/1) +[Teste den regulären Ausdruck](https://regex101.com/r/jnk6gM/1)
 "/.(at)/g" => The fat cat sat on the mat.
 
-[Test the regular expression](https://regex101.com/r/dO1nef/1) +[Teste den regulären Ausdruck](https://regex101.com/r/dO1nef/1) ### 5.3 Multiline The `m` modifier is used to perform a multi-line match. As we discussed earlier anchors `(^, $)` are used to check if pattern is the beginning of the input or end of the input string. But if we want that anchors works on each line we use -`m` flag. For example, the regular expression `/at(.)?$/gm` means: lowercase +`m` flag. For example, der reguläre Ausdruck `/at(.)?$/gm` means: lowercase character `a`, followed by lowercase character `t`, optionally anything except new line. And because of `m` flag now regular expression engine matches pattern at the end of each line in a string. @@ -544,7 +536,7 @@ at the end of each line in a string. on the mat. -[Test the regular expression](https://regex101.com/r/hoGMkP/1) +[Teste den regulären Ausdruck](https://regex101.com/r/hoGMkP/1)
 "/.at(.)?$/gm" => The fat
@@ -552,7 +544,7 @@ at the end of each line in a string.
                   on the mat.
 
-[Test the regular expression](https://regex101.com/r/E88WE2/1) +[Teste den regulären Ausdruck](https://regex101.com/r/E88WE2/1) ## 6. Greedy vs lazy matching By default regex will do greedy matching , means it will match as long as @@ -562,13 +554,13 @@ possible. we can use `?` to match in lazy way means as short as possible "/(.*at)/" => The fat cat sat on the mat. -[Test the regular expression](https://regex101.com/r/AyAdgJ/1) +[Teste den regulären Ausdruck](https://regex101.com/r/AyAdgJ/1)
 "/(.*?at)/" => The fat cat sat on the mat. 
-[Test the regular expression](https://regex101.com/r/AyAdgJ/2) +[Teste den regulären Ausdruck](https://regex101.com/r/AyAdgJ/2) ## Contribution From fc63d63974e9b6698b74553969e27a8df2c9faf5 Mon Sep 17 00:00:00 2001 From: Frank Bueltge Date: Mon, 20 Apr 2020 15:32:12 +0200 Subject: [PATCH 08/16] Update anker links --- translations/README-de.md | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/translations/README-de.md b/translations/README-de.md index b8b0946..586dccd 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -43,33 +43,33 @@ Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, ` ## Table of Contents -- [Basis Vergleiche](#1-basic-matchers) -- [Sonderzeichen](#2-meta-characters) - - [Punkt](#21-full-stop) - - [Zeichensätze](#22-zeichensaetze) - - [Invertierter Zeichensatz](#221-negated-character-set) - - [Wiederholungen](#23-repetitions) - - [Stern *](#231-the-star) - - [Plus +](#232-the-plus) - - [Fragezeichen ?](#233-the-question-mark) - - [Klammern {}](#24-braces) - - [Zeichengruppen](#25-character-group) +- [Basis Vergleiche](#1-basis-vergleiche) +- [Sonderzeichen](#2-sonderzeichen) + - [Punkt](#21-punkt) + - [Zeichensätze](#22-zeichensätze) + - [Invertierter Zeichensatz](#221-invertierter-zeichensatz) + - [Wiederholungen](#23-wiederholungen) + - [Stern *](#231-stern) + - [Plus +](#232-plus) + - [Fragezeichen ?](#233-fragezeichen) + - [Klammern {}](#24-klammern) + - [Zeichengruppen](#25-zeichengruppen) - [Alternation |](#26-alternation) - - [Auswertung von Sonderzeichen](#27-escaping-special-character) - - [Anker](#28-anchors) + - [Auswertung von Sonderzeichen](#27-auswertung-von-sonderzeichen) + - [Anker](#28-anker) - [Caret ^](#281-caret) - [Dollar $](#282-dollar) -- [Kurzschreibweisen](#3-shorthand-character-sets) -- [Umschauen](#4-lookaround) - - [Positives Vorrausschauen](#41-positive-lookahead) - - [Negatives Vorrausschauen](#42-negative-lookahead) - - [Positives Zurückschauen](#43-positive-lookbehind) - - [Negatives Zurückschauen](#44-negative-lookbehind) -- [Steuerparameter](#5-flags) - - [Groß-/Kleinschreibung](#51-case-insensitive) - - [Globale Suche](#52-global-search) - - [Mehrzeilig](#53-multiline) -- [Gierige oder faule Übereinstimmung](#6-greedy-vs-lazy-matching) +- [Kurzschreibweisen](#3-kurzschreibweisen) +- [Umschauen](#4-umschauen) + - [Positives Vorrausschauen](#41-positives-vorausschauen) + - [Negatives Vorrausschauen](#42-negatives-vorausschauen) + - [Positives Zurückschauen](#43-positives-zurückschauen) + - [Negatives Zurückschauen](#44-negatives-zurückschauen) +- [Steuerparameter](#5-steuerparameter) + - [Groß-/Kleinschreibung](#51-groß-kleinschreibung) + - [Globale Suche](#52-globale-suche) + - [Mehrzeilig](#53-mehrzeilig) +- [Gierige oder faule Übereinstimmung](#6-gierige-oder-faule-übereinstimmung) ## 1. Basis Vergleiche From b351c28cd855a0b771069b30bfdb7ab1215a6371 Mon Sep 17 00:00:00 2001 From: Frank Bueltge Date: Mon, 20 Apr 2020 15:46:14 +0200 Subject: [PATCH 09/16] chanpter 2.2 done --- translations/README-de.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/translations/README-de.md b/translations/README-de.md index 586dccd..0533c61 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -127,9 +127,7 @@ Zeichensätze werden auch als Zeichenklasse bezeichnet. Zeichensätze werden in [Teste den regulären Ausdruck](https://regex101.com/r/2ITLQ4/1) -A period inside a character set, however, means a literal period. The regular -expression `ar[.]` means: a lowercase character `a`, followed by letter `r`, -followed by a period `.` character. +Ein Punkt in einem Zeichensatz bedeutet jedoch einen wörtlichen Punkt. Der reguläre Ausdruck `ar[.]` bedeutet: ein kleingeschriebenes Zeichen `a`, gefolgt vom kleingeschriebenen Buchstaben `r`, gefolgt von dem wörtlichen Zeichen Punkt `.`.
 "ar[.]" => A garage is a good place to park a car.
@@ -137,12 +135,9 @@ followed by a period `.` character.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/wL3xtE/1)
 
-### 2.2.1 Negated character set
+### 2.2.1 Invertierter Zeichensatz
 
-In general, the caret symbol represents the start of the string, but when it is
-typed after the opening square bracket it negates the character set. For
-example, der reguläre Ausdruck `[^c]ar` means: any character except `c`,
-followed by the character `a`, followed by the letter `r`.
+Im Allgemeinen stellt das Caret-Symbol `^` den Anfang einer Zeichenkette dar. Wenn es aber nach der öffnenden eckigen Klammer gesetzt wird, dann wird der Zeichensatz negiert. Als Beispiel, der reguläre Ausdruck `[^c]ar` bedeutet: jeder Buchstabe außer `c`, gefolgt vom Buchstaben `a`, gefolgt vom Buchstaben `r`. 
 
 
 "[^c]ar" => The car parked in the garage.

From 4fc2c9ed700e10dfd4bcc9acd04fc91aa17df53c Mon Sep 17 00:00:00 2001
From: JohnnyJayJay 
Date: Wed, 24 Jun 2020 22:36:42 +0200
Subject: [PATCH 10/16] Improve grammar and wording of previous sections, begin
 working on missing sections

---
 translations/README-de.md | 81 ++++++++++++++++++---------------------
 1 file changed, 37 insertions(+), 44 deletions(-)

diff --git a/translations/README-de.md b/translations/README-de.md
index 0533c61..1de27b6 100644
--- a/translations/README-de.md
+++ b/translations/README-de.md
@@ -71,9 +71,9 @@ Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, `
   - [Mehrzeilig](#53-mehrzeilig)
 - [Gierige oder faule Übereinstimmung](#6-gierige-oder-faule-übereinstimmung)
 
-## 1. Basis Vergleiche
+## 1. Einfache Muster
 
-Ein regulärer Ausdruck ist ein einfaches Muster von Zeichen, welches für eine Suche in Text genutzt wird. Zum Beispiel, der reguläre Ausdruck `the` meint: der Buchstabe `t`, gefolgt durch den Buchstaben `h`, gefolgt durch den Buchstaben `e`.
+Ein regulärer Ausdruck ist einfach nur ein Muster von Zeichen, welches für eine Suche in Text genutzt wird. Der reguläre Ausdruck `the` heißt zum Beispiel: der Buchstabe `t`, gefolgt von dem Buchstaben `h`, gefolgt von dem Buchstaben `e`.
 
 
 "the" => The fat cat sat on the mat.
@@ -81,7 +81,7 @@ Ein regulärer Ausdruck ist ein einfaches Muster von Zeichen, welches für eine
 
 [Teste den regulären Ausdruck](https://regex101.com/r/dmRygT/1)
 
-Der reguläre Ausdruck `123` entspricht der Zeichenkette `123`. Dieser reguläre Ausdruck kann mit einer Zeichenkette verglichen werden, in dem jedes Zeichen in dem regulären Ausdruck nacheinander verglichen wird. Reguläre Ausdrücke sind normalerweise case sensitiv, Beachtung von Groß-/Kleinschreibung, so dass der Ausdruck `The` nicht mit der Zeichenkette  `the` überein stimmen würde. 
+Der reguläre Ausdruck `123` entspricht der Zeichenkette `123`. Dieser reguläre Ausdruck wird auf Übereinstimmung mit einer Zeichenkette überprüft, indem jedes Zeichen in dem regulären Ausdruck nacheinander mit den Zeichen in der Zeichenkette verglichen wird. Reguläre Ausdrücke sind normalerweise case sensitiv, Beachtung von Groß-/Kleinschreibung, sodass der Ausdruck `The` nicht mit der Zeichenkette  `the` überein stimmen würde. 
 
 
 "The" => The fat cat sat on the mat.
@@ -118,16 +118,16 @@ Der Punkt `.` ist die einfachste Möglichkeit von Sonderzeichen. Das Sonderzeich
 
[Teste den regulären Ausdruck](https://regex101.com/r/xc9GkU/1) -## 2.2 Zeichensätze +## 2.2 Zeichenklasse -Zeichensätze werden auch als Zeichenklasse bezeichnet. Zeichensätze werden in eckige Klammern angegeben. Um den Bereich der Zeichen anzugeben ist ein Bindestrich zu verwenden. Die Reihenfolge des Bereiches in den eckigen Klammern spielt keine Rolle. Zum Beispiel bedeutet der reguläre Ausdruck `[Tt]he`: ein groß geschriebenes `T` oder ein kleingeschriebenes `t`, gefolgt vom Buchstaben `h` und weiter gefolgt vom Buchstaben `e`. +Zeichenklassen werden auch als Zeichenmengen oder -sätze bezeichnet. Sie werden in eckige Klammern definiert. Um eine Zeichenfolge wie `A-Z` oder `0-9` zu definieren, kann ein Bindestrich `-` verwendet werden. Die Reihenfolge sonstiger Zeichen innerhalb der eckigen Klammern spielt keine Rolle. Zum Beispiel bedeutet der reguläre Ausdruck `[Tt]he`: ein groß geschriebenes `T` oder ein kleingeschriebenes `t`, gefolgt vom Buchstaben `h` und weiter gefolgt vom Buchstaben `e`.
 "[Tt]he" => The car parked in the garage.
 
[Teste den regulären Ausdruck](https://regex101.com/r/2ITLQ4/1) -Ein Punkt in einem Zeichensatz bedeutet jedoch einen wörtlichen Punkt. Der reguläre Ausdruck `ar[.]` bedeutet: ein kleingeschriebenes Zeichen `a`, gefolgt vom kleingeschriebenen Buchstaben `r`, gefolgt von dem wörtlichen Zeichen Punkt `.`. +Ein Punkt in einer Zeichenklasse bedeutet, anders als sonst, einen wörtlichen Punkt. Der reguläre Ausdruck `ar[.]` bedeutet: ein kleingeschriebenes Zeichen `a`, gefolgt vom kleingeschriebenen Buchstaben `r`, gefolgt von einem Punkt-Zeichen `.`.
 "ar[.]" => A garage is a good place to park a car.
@@ -135,9 +135,9 @@ Ein Punkt in einem Zeichensatz bedeutet jedoch einen wörtlichen Punkt. Der regu
 
 [Teste den regulären Ausdruck](https://regex101.com/r/wL3xtE/1)
 
-### 2.2.1 Invertierter Zeichensatz
+### 2.2.1 Negierte Zeichenklasse
 
-Im Allgemeinen stellt das Caret-Symbol `^` den Anfang einer Zeichenkette dar. Wenn es aber nach der öffnenden eckigen Klammer gesetzt wird, dann wird der Zeichensatz negiert. Als Beispiel, der reguläre Ausdruck `[^c]ar` bedeutet: jeder Buchstabe außer `c`, gefolgt vom Buchstaben `a`, gefolgt vom Buchstaben `r`. 
+Im Allgemeinen stellt das Zirkumflex `^` den Anfang einer Zeichenkette dar. Wenn es aber nach der öffnenden eckigen Klammer gesetzt wird, dann wird die Zeichenklasse negiert. Als Beispiel, der reguläre Ausdruck `[^c]ar` bedeutet: ein beliebiges Zeichen außer `c`, gefolgt vom Buchstaben `a`, gefolgt vom Buchstaben `r`. 
 
 
 "[^c]ar" => The car parked in the garage.
@@ -145,19 +145,17 @@ Im Allgemeinen stellt das Caret-Symbol `^` den Anfang einer Zeichenkette dar. We
 
 [Teste den regulären Ausdruck](https://regex101.com/r/nNNlq3/1)
 
-## 2.3 Repetitions
+## 2.3 Wiederholungen
 
-Following meta characters `+`, `*` or `?` are used to specify how many times a
-subpattern can occur. These meta characters act differently in different
-situations.
+Die Metazeichen `+`, `*` und `?` bieten einen einfachen Weg, anzugeben, wie oft sich ein bestimmter Teilausdruck wiederholen soll. Sie gehören damit zu den sogenannten "Quantoren".
+Sie können sich je nach Situation unterschiedlich verhalten.
 
-### 2.3.1 The Star
+### 2.3.1 Der Stern
 
-The symbol `*` matches zero or more repetitions of the preceding matcher. The
-regular expression `a*` means: zero or more repetitions of preceding lowercase
-character `a`. But if it appears after a character set or class then it finds
-the repetitions of the whole character set. For example, der reguläre Ausdruck
-`[a-z]*` means: any number of lowercase letters in a row.
+Das Symbol `*` stimmt mit beliebig vielen Wiederholungen des vorhergehenden Teilausdrucks überein. Der Ausdruck `a*` heißt: 
+null, eins oder mehrere `a`s in Folge. Da sich der Stern auf Teilausdrücke bezieht, kann er auch bspw. hinter einer Zeichenklasse stehen
+und stimmt dann mit beliebig vielen Zeichen aus der Klasse in Folge überein. Zum Beispiel bedeutet der Ausdruck `[a-z]*`: eine 
+beliebige Anzahl von Kleinbuchstaben in Folge.
 
 
 "[a-z]*" => The car parked in the garage #21.
@@ -165,12 +163,10 @@ the repetitions of the whole character set. For example, der reguläre Ausdruck
 
 [Teste den regulären Ausdruck](https://regex101.com/r/7m8me5/1)
 
-The `*` symbol can be used with the meta character `.` to match any string of
-characters `.*`. The `*` symbol can be used with the whitespace character `\s`
-to match a string of whitespace characters. For example, the expression
-`\s*cat\s*` means: zero or more spaces, followed by lowercase character `c`,
-followed by lowercase character `a`, followed by lowercase character `t`,
-followed by zero or more spaces.
+Das `*`-Symbol kann zusammen mit dem Metazeichen `.` verwendet werden, um mit einer vollkommen beliebigen Zeichenkette übereinzustimmen `.*`.
+Es kann auch mit der vordefinierten Zeichenklasse `\s` verwendet werden, um mit beliebig viel Leerraum (Leerzeichen, Tabulatoren, Zeilenumbrüchen)
+übereinzustimmen. Der Ausdruck `\s*cat\*` heißt zum Beispiel: null oder mehrere Leerzeichen, gefolgt von dem Buchstaben `c`, gefolgt vom Buchstaben `a`, 
+gefolgt vom Buchstaben `t` und schließlich gefolgt von null oder mehreren Leerzeichen.
 
 
 "\s*cat\s*" => The fat cat sat on the concatenation.
@@ -178,12 +174,11 @@ followed by zero or more spaces.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/gGrwuz/1)
 
-### 2.3.2 The Plus
+### 2.3.2 Das Plus
 
-The symbol `+` matches one or more repetitions of the preceding character. For
-example, der reguläre Ausdruck `c.+t` means: lowercase letter `c`, followed by
-at least one character, followed by the lowercase character `t`. It needs to be
-clarified that `t` is the last `t` in the sentence.
+Das `+`-Symbol stimmt mit einer oder mehr Wiederholungen des vorhergehenden Teilausdrucks überein. Der reguläre Ausdruck
+`c.+t` bedeutet: Buchstabe `c`, gefolgt von mindestens einem beliebigen Zeichen, gefolgt vom Buchstaben `t`. Das `t` ist dabei
+das letzte `t` in der hier zu sehenden Übereinstimmung, wobei es hier auch weitere Übereinstimmungen gäbe (siehe "Teste den regulären Ausdruck").
 
 
 "c.+t" => The fat cat sat on the mat.
@@ -191,13 +186,11 @@ clarified that `t` is the last `t` in the sentence.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/Dzf9Aa/1)
 
-### 2.3.3 The Question Mark
+### 2.3.3 Das Fragezeichen
 
-In regular expression the meta character `?` makes the preceding character
-optional. This symbol matches zero or one instance of the preceding character.
-For example, der reguläre Ausdruck `[T]?he` means: Optional the uppercase
-letter `T`, followed by the lowercase character `h`, followed by the lowercase
-character `e`.
+In regulären Ausdrücken sorgt das Metazeichen `?` dafür, dass der vorhergehende Teilausdruck optional wird.
+Somit stimmt es mit null oder einer Übereinstimmung des Teilausdrucks überein.
+Zum Beispiel heißt der reguläre Ausdruck `[T]?he`: ein oder kein `T`, gefolgt von dem Buchstaben `h`, gefolgt von dem Buchstaben `e`.
 
 
 "[T]he" => The car is parked in the garage.
@@ -211,12 +204,11 @@ character `e`.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/kPpO2x/1)
 
-## 2.4 Braces
+## 2.4 Geschweifte Klammern
 
-In regular expression braces that are also called quantifiers are used to
-specify the number of times that a character or a group of characters can be
-repeated. For example, der reguläre Ausdruck `[0-9]{2,3}` means: Match at least
-2 digits but not more than 3 ( characters in the range of 0 to 9).
+Geschweifte Klammern `{}` gehören wie die zuvor behandelten Metazeichen zu den Quantoren. Sie werden verwendet, 
+um genau anzugeben wie oft ein Teilausdruck minimal und maximal hintereinander übereinstimmen muss.
+Zum Beispiel bedeutet der reguläre Ausdruck `[0-9]{2,3}`: Mindestens zwei, aber maximal drei Ziffern (Zeichenfolge 0-9) hintereinander.
 
 
 "[0-9]{2,3}" => The number was 9.9997 but we rounded it off to 10.0.
@@ -224,9 +216,8 @@ repeated. For example, der reguläre Ausdruck `[0-9]{2,3}` means: Match at least
 
 [Teste den regulären Ausdruck](https://regex101.com/r/juM86s/1)
 
-We can leave out the second number. For example, der reguläre Ausdruck
-`[0-9]{2,}` means: Match 2 or more digits. If we also remove the comma the
-regular expression `[0-9]{3}` means: Match exactly 3 digits.
+Die zweite Zahl kann ausgelassen werden. Somit heißt der Ausdruck `[0-9]{2,}`: zwei oder mehr Ziffern in Folge.
+Wenn wir auch das Komma entfernen, heißt `[0-9]{3}`: genau drei Ziffern in Folge.
 
 
 "[0-9]{2,}" => The number was 9.9997 but we rounded it off to 10.0.
@@ -240,7 +231,9 @@ regular expression `[0-9]{3}` means: Match exactly 3 digits.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/Sivu30/1)
 
-## 2.5 Capturing Group
+## 2.5 Gruppierungen
+
+Eine Gruppierung fasst eine Gruppe von Teilausdrücken in Klammern `(...)` zusammen. 
 
 A capturing group is a group of sub-patterns that is written inside Parentheses 
 `(...)`. Like as we discussed before that in regular expression if we put a quantifier 

From e21f70b7dc8bcba5792f91711c156aa18c06bacf Mon Sep 17 00:00:00 2001
From: JohnnyJayJay <39348311+JohnnyJayJay@users.noreply.github.com>
Date: Thu, 25 Jun 2020 16:08:45 +0200
Subject: [PATCH 11/16] Continue work until flags

---
 translations/README-de.md | 276 +++++++++++++++++---------------------
 1 file changed, 125 insertions(+), 151 deletions(-)

diff --git a/translations/README-de.md b/translations/README-de.md
index 1de27b6..fd85286 100644
--- a/translations/README-de.md
+++ b/translations/README-de.md
@@ -46,14 +46,14 @@ Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, `
 - [Basis Vergleiche](#1-basis-vergleiche)
 - [Sonderzeichen](#2-sonderzeichen)
   - [Punkt](#21-punkt)
-  - [Zeichensätze](#22-zeichensätze)
-    - [Invertierter Zeichensatz](#221-invertierter-zeichensatz)
+  - [Zeichenklasse](#22-zeichenklasse)
+    - [Negierte Zeichenklasse](#221-negierte-zeichenklasse)
   - [Wiederholungen](#23-wiederholungen)
-    - [Stern *](#231-stern)
-    - [Plus +](#232-plus)
-    - [Fragezeichen ?](#233-fragezeichen)
-  - [Klammern {}](#24-klammern)
-  - [Zeichengruppen](#25-zeichengruppen)
+    - [Stern *](#231-der-stern)
+    - [Plus +](#232-das-plus)
+    - [Fragezeichen ?](#233-das-fragezeichen)
+  - [Geschweifte Klammern {}](#24-geschweifte-klammern)
+  - [Gruppierung](#25-gruppierung)
   - [Alternation |](#26-alternation)
   - [Auswertung von Sonderzeichen](#27-auswertung-von-sonderzeichen)
   - [Anker](#28-anker)
@@ -89,29 +89,30 @@ Der reguläre Ausdruck `123` entspricht der Zeichenkette `123`. Dieser reguläre
 
 [Teste den regulären Ausdruck](https://regex101.com/r/1paXsy/1)
 
-## 2. Sonderzeichen
+## 2. Metazeichen
 
-Sonderzeichen sind Bausteine von regulären Ausdrücken. Sonderzeichen stehen nicht für sich selbst, sondern werden in speziellen Fällen interpretiert. Einige Sonderzeichen haben eine besondere Bedeutung und sind innerhalb eckiger Klammern `[]`. Folgende Sonderzeichen sind möglich:
+Metazeichen sind Bausteine von regulären Ausdrücken. Sie stehen nicht für sich selbst, sondern haben eine besondere Bedeutung und werden in spezieller Weise interpretiert.
+Einige Metazeichen erhalten eine andere Bedeutung oder überhaupt erst eine besondere Bedeutung innerhalb eckiger Klammern `[]`. Folgende Metazeichen gibt es:
 
-|Sonderzeichen|Beschreibung|
+|Metazeichen|Beschreibung|
 |:----:|----|
-|.|Der Punkt entspricht jedem einzelnen Zeichen, außer einem Zeilenumbruch.|
-|[ ]|Zeichen-Klasse, entspricht jedem Zeichen innerhalb der eckigen Klammern.|
-|[^ ]|Negierte Zeichen-Klasse, entspricht jedem Zeichen welches nicht innerhalb der eckigen Klammern definiert ist.|
-|*|Entspricht 0 oder mehr Wiederholungen der voran gestellten Zeichen.|
-|+|Entspricht 1 oder mehr Wiederholungen der voran gestellten Zeichen.|
-|?|Macht das vorhergehende Zeichen optional.|
-|{n,m}|Klammern, entspricht mindestens "n", aber nicht mehr als "m" Wiederholungen des Zeichens.|
-|(xyz)|Zeichengruppe, entspricht den Zeichen xyz in der exakten Reihenfolge.|
-|||Alternation, entspricht entweder den Zeichen vor oder nach dem Sonderzeichen \|.|
-|\|Entfernt das nachfolgende Zeichen. Dies ermöglicht es Zeichen zu blockieren [ ] ( ) { } . * + ? ^ $ \ ||
-|^|Überprüft den Anfang einer Eingabe.|
-|$|Überprüft das Ende einer Eingabe.|
+|.|Der Punkt entspricht jedem einzelnen Zeichen, außer Zeilenumbrüchen.|
+|[ ]|Zeichenklasse, entspricht jedem Zeichen innerhalb der eckigen Klammern.|
+|[^ ]|Negierte Zeichenklasse, entspricht jedem Zeichen welches nicht innerhalb der eckigen Klammern definiert ist.|
+|*|Entspricht 0 oder mehr Wiederholungen des vorhergehenden Teilausdrucks.|
+|+|Entspricht 1 oder mehr Wiederholungen des vorhergehenden Teilausdrucks.|
+|?|Macht den vorhergehenden Teilausdruck optional.|
+|{n,m}|Entspricht mindestens "n", aber nicht mehr als "m" Wiederholungen des vorhergehenden Teilausdrucks.|
+|(xyz)|Gruppierung, entspricht den Zeichen xyz in der exakten Reihenfolge.|
+|||Alternation, entspricht entweder dem Teilausdruck vor oder nach dem \|.|
+|\|Escaped das nachfolgende Zeichen. Dies ermöglicht es Zeichen zu blockieren [ ] ( ) { } . * + ? ^ $ \ ||
+|^|Entspricht dem Anfang der Eingabe.|
+|$|Entspricht dem Ende der Eingabe.|
 
 ## 2.1 Punkt
 
-Der Punkt `.` ist die einfachste Möglichkeit von Sonderzeichen. Das Sonderzeichen `.`
- entspricht jedem einzelnen Zeichen. Es wird kein Zeilenumbruch oder Enter-Zeichen gefunden. Als Beispiel, der reguläre Ausdruck `.ar` bedeutet: ein beliebiges Zeichen, gefolgt von dem Buchstaben `a`, gefolgt vom Buchstaben `r`.
+Der Punkt `.` ist das einfachste Beispiel für ein Metazeichen. Er steht für jedes beliebiges Zeichen mit der Ausnahme von Zeilenumbrüchen/Enter-Zeichen. 
+Als Beispiel, der reguläre Ausdruck `.ar` bedeutet: ein beliebiges Zeichen, gefolgt von dem Buchstaben `a`, gefolgt vom Buchstaben `r`.
 
 
 ".ar" => The car parked in the garage.
@@ -120,7 +121,7 @@ Der Punkt `.` ist die einfachste Möglichkeit von Sonderzeichen. Das Sonderzeich
 
 ## 2.2 Zeichenklasse
 
-Zeichenklassen werden auch als Zeichenmengen oder -sätze bezeichnet. Sie werden in eckige Klammern definiert. Um eine Zeichenfolge wie `A-Z` oder `0-9` zu definieren, kann ein Bindestrich `-` verwendet werden. Die Reihenfolge sonstiger Zeichen innerhalb der eckigen Klammern spielt keine Rolle. Zum Beispiel bedeutet der reguläre Ausdruck `[Tt]he`: ein groß geschriebenes `T` oder ein kleingeschriebenes `t`, gefolgt vom Buchstaben `h` und weiter gefolgt vom Buchstaben `e`.
+Zeichenklassen werden auch als Zeichenmengen oder -sätze bezeichnet (eng. *character set/class*). Sie werden in eckige Klammern definiert. Um eine Zeichenfolge wie `A-Z` oder `0-9` zu definieren, kann ein Bindestrich `-` verwendet werden. Die Reihenfolge sonstiger Zeichen innerhalb der eckigen Klammern spielt keine Rolle. Zum Beispiel bedeutet der reguläre Ausdruck `[Tt]he`: ein groß geschriebenes `T` oder ein kleingeschriebenes `t`, gefolgt vom Buchstaben `h` und weiter gefolgt vom Buchstaben `e`.
 
 
 "[Tt]he" => The car parked in the garage.
@@ -137,7 +138,7 @@ Ein Punkt in einer Zeichenklasse bedeutet, anders als sonst, einen wörtlichen P
 
 ### 2.2.1 Negierte Zeichenklasse
 
-Im Allgemeinen stellt das Zirkumflex `^` den Anfang einer Zeichenkette dar. Wenn es aber nach der öffnenden eckigen Klammer gesetzt wird, dann wird die Zeichenklasse negiert. Als Beispiel, der reguläre Ausdruck `[^c]ar` bedeutet: ein beliebiges Zeichen außer `c`, gefolgt vom Buchstaben `a`, gefolgt vom Buchstaben `r`. 
+Im Allgemeinen stellt das Zirkumflex `^` den Anfang einer Zeichenkette dar. Wenn es aber nach der öffnenden eckigen Klammer gesetzt wird, dann wird die Zeichenklasse negiert (eng. *negated character set*). Als Beispiel, der reguläre Ausdruck `[^c]ar` bedeutet: ein beliebiges Zeichen außer `c`, gefolgt vom Buchstaben `a`, gefolgt vom Buchstaben `r`. 
 
 
 "[^c]ar" => The car parked in the garage.
@@ -147,7 +148,7 @@ Im Allgemeinen stellt das Zirkumflex `^` den Anfang einer Zeichenkette dar. Wenn
 
 ## 2.3 Wiederholungen
 
-Die Metazeichen `+`, `*` und `?` bieten einen einfachen Weg, anzugeben, wie oft sich ein bestimmter Teilausdruck wiederholen soll. Sie gehören damit zu den sogenannten "Quantoren".
+Die Metazeichen `+`, `*` und `?` bieten einen einfachen Weg, anzugeben, wie oft sich ein bestimmter Teilausdruck wiederholen soll. Sie gehören damit zu den sogenannten "Quantifizierern" (eng. *quantifier*).
 Sie können sich je nach Situation unterschiedlich verhalten.
 
 ### 2.3.1 Der Stern
@@ -206,7 +207,7 @@ Zum Beispiel heißt der reguläre Ausdruck `[T]?he`: ein oder kein `T`, gefolgt
 
 ## 2.4 Geschweifte Klammern
 
-Geschweifte Klammern `{}` gehören wie die zuvor behandelten Metazeichen zu den Quantoren. Sie werden verwendet, 
+Geschweifte Klammern `{}` gehören wie die zuvor behandelten Metazeichen zu den Quantifizierern. Sie werden verwendet, 
 um genau anzugeben wie oft ein Teilausdruck minimal und maximal hintereinander übereinstimmen muss.
 Zum Beispiel bedeutet der reguläre Ausdruck `[0-9]{2,3}`: Mindestens zwei, aber maximal drei Ziffern (Zeichenfolge 0-9) hintereinander.
 
@@ -233,16 +234,11 @@ Wenn wir auch das Komma entfernen, heißt `[0-9]{3}`: genau drei Ziffern in Folg
 
 ## 2.5 Gruppierungen
 
-Eine Gruppierung fasst eine Gruppe von Teilausdrücken in Klammern `(...)` zusammen. 
-
-A capturing group is a group of sub-patterns that is written inside Parentheses 
-`(...)`. Like as we discussed before that in regular expression if we put a quantifier 
-after a character then it will repeat the preceding character. But if we put quantifier
-after a capturing group then it repeats the whole capturing group. For example,
-der reguläre Ausdruck `(ab)*` matches zero or more repetitions of the character
-"ab". We can also use the alternation `|` meta character inside capturing group.
-For example, der reguläre Ausdruck `(c|g|p)ar` means: lowercase character `c`,
-`g` or `p`, followed by character `a`, followed by character `r`.
+Eine Gruppierung (eng. *capturing group*) fasst eine Gruppe von Teilausdrücken in Klammern `(...)` zusammen. 
+Eine Gruppierung selbst ist ebenfalls ein Teilausdruck, weshalb Quantoren wie `{}`, `*` oder `?` auf sie angewendet werden können.
+Zum Beispiel stimmt der reguläre Ausdruck `(ab)*` mit null oder mehr Vorkommen von `a` und `b` hintereinander überein.
+Auch das "Oder"-Metazeichen `|` kann innerhalb einer Gruppierung verwendet werden. Der reguläre Ausdruck `(c|g|p)ar` bedeutet:
+kleines `c`, `g` oder `p`, gefolgt vom Buchstaben `a`, gefolgt vom Buchstaben `r`. Dies ist äquivalent zu `[cgp]ar`.
 
 
 "(c|g|p)ar" => The car is parked in the garage.
@@ -250,16 +246,16 @@ For example, der reguläre Ausdruck `(c|g|p)ar` means: lowercase character `c`,
 
 [Teste den regulären Ausdruck](https://regex101.com/r/tUxrBG/1)
 
-Note that capturing groups do not only match but also capture the characters for use in 
-the parent language. The parent language could be python or javascript or virtually any
-language that implements regular expressions in a function definition.
+Gruppierungen stimmen nicht nur mit Zeichenketten überein, sondern "merken" sich auch die übereinstimmenden Zeichen in der Gruppe für die Verwendung in der Elternsprache
+(auch Rückwärtsreferenz genannt).
+Die Elternsprache kann Python, JavaScript oder sonst irgendeine Sprache sein, die reguläre Ausdrücke implementiert.
 
-### 2.5.1 Non-capturing group
 
-A non-capturing group is a capturing group that only matches the characters, but 
-does not capture the group. A non-capturing group is denoted by a `?` followed by a `:` 
-within parenthesis `(...)`. For example, der reguläre Ausdruck `(?:c|g|p)ar` is similar to 
-`(c|g|p)ar` in that it matches the same characters but will not create a capture group.
+### 2.5.1 Gruppierungen ohne Rückwärtsreferenz
+
+Gruppierungen ohne Rückwärtsreferenz (eng. *non-capturing groups*) sind Gruppierungen, die nur mit den Zeichen übereinstimmen, diese aber nicht für spätere Verwendung zwischenspeichern.
+Solche Gruppierungen werden mit einem `?`, gefolgt von einem `:` in Klammern `(...)` definiert.
+Somit gleicht der reguläre Ausdruck `(?:c|g|p)ar` dem Ausdruck `(c|g|p)ar` in seiner Übereinstimmung mit den Zeichenketten, aber im Gegensatz erzeugt er keine Rückwärtsreferenz.
 
 
 "(?:c|g|p)ar" => The car is parked in the garage.
@@ -267,22 +263,19 @@ within parenthesis `(...)`. For example, der reguläre Ausdruck `(?:c|g|p)ar` is
 
 [Teste den regulären Ausdruck](https://regex101.com/r/Rm7Me8/1)
 
-Non-capturing groups can come in handy when used in find-and-replace functionality or 
-when mixed with capturing groups to keep the overview when producing any other kind of output. 
-See also [4. Lookaround](#4-lookaround).
+Gruppierungen ohne Rückwärtsreferenz können für Finden-und-Ersetzen oder in Kombination mit normalen Gruppierungen nützlich sein, um den Überblick zu behalten, 
+wenn auf Basis der Übereinstimmungen eine Ausgabe erzeugt wird. Siehe auch [4. Lookaround](#4-lookaround).
 
 ## 2.6 Alternation
 
-In a regular expression, the vertical bar `|` is used to define alternation.
-Alternation is like an OR statement between multiple expressions. Now, you may be
-thinking that character set and alternation works the same way. But the big
-difference between character set and alternation is that character set works on
-character level but alternation works on expression level. For example, the
-regular expression `(T|t)he|car` means: either (uppercase character `T` or lowercase
-`t`, followed by lowercase character `h`, followed by lowercase character `e`) OR
-(lowercase character `c`, followed by lowercase character `a`, followed by
-lowercase character `r`). Note that I put the parentheses for clarity, to show that either expression
-in parentheses can be met and it will match.
+In einem regulären Ausdruck wird der Trennstrich `|` verwendet, um Alternativen (eng. *alternation*) zu definieren.
+Alternation ist wie ein "ODER" zwischen mehreren Teilausdrücken. Nun könnte man annehmen, dass
+Zeichenklassen und Alternation auf die gleiche Art und Weise funktionieren. Aber der große Unterschied 
+zwischen diesen beiden ist, dass Zeichenklassen für einzelne Zeichen funktionieren, während für Alternationen
+beliebige Teilausdrücke verwendet werden können. So heißt der reguläre Ausdruck `(T|t)he|car` beispielsweise:
+Entweder ein großes `T` oder kleines `t`, dann der Buchstabe `h` gefolgt vom Buchstaben `e` ODER 
+`c`, gefolgt von `a`, gefolgt von `r`. Man beachte die Klammern, die zur Trennung der einen Alternation von der anderen
+gesetzt wurden.
 
 
 "(T|t)he|car" => The car is parked in the garage.
@@ -290,18 +283,15 @@ in parentheses can be met and it will match.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/fBXyX0/1)
 
-## 2.7 Escaping special character
+## 2.7 Escape
 
-Backslash `\` is used in regular expression to escape the next character. This
-allows us to specify a symbol as a matching character including reserved
-characters `{ } [ ] / \ + * . $ ^ | ?`. To use a special character as a matching
-character prepend `\` before it.
+Der Backslash `\` wird in regulären Ausdrücken verwendet, um die besondere Bedeutung des folgenden Zeichens aufzuheben (eng. *escape*) oder ihm eine besondere Bedeutung zu verleihen 
+(s. [Vordefinierte Zeichenklassen](#3-vordefinierte-zeichenklassen)).
+Er erlaubt es, für andere Zwecke reservierte Zeichen wie die Metazeichen `{ } [ ] / \ + * . $ ^ | ?` als Literale, also wörtliche Übereinstimmungen zu nutzen.
+Um mit einem besonderen Zeichen wortwörtlich übereinzustimmen, muss es auf ein `\` folgen.
 
-For example, der reguläre Ausdruck `.` is used to match any character except
-newline. Now to match `.` in an input string der reguläre Ausdruck
-`(f|c|m)at\.?` means: lowercase letter `f`, `c` or `m`, followed by lowercase
-character `a`, followed by lowercase letter `t`, followed by optional `.`
-character.
+Der reguläre Ausdruck `.` zum Beispiel wird benutzt, um mit einem beliebigen Zeichen übereinzustimmen. 
+Der Ausdruck `(f|c|m)at\.?` hebt diese Bedeutung auf: `f`, `c` oder `m`, gefolgt von `a`, gefolgt von `t`, schließlich gefolgt von einem optionalen `.`.
 
 
 "(f|c|m)at\.?" => The fat cat sat on the mat.
@@ -309,24 +299,19 @@ character.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/DOc5Nu/1)
 
-## 2.8 Anchors
+## 2.8 Anker
 
-In regular expressions, we use anchors to check if the matching symbol is the
-starting symbol or ending symbol of the input string. Anchors are of two types:
-First type is Caret `^` that check if the matching character is the start
-character of the input and the second type is Dollar `$` that checks if matching
-character is the last character of the input string.
+In regulären Audrücken werden Anker (eng. *anchor*) verwendet, um zu überprüfen, ob der Teilausdruck mit dem 
+Anfang oder dem Ende der Teilausgabe übereinstimmt. Es gibt zwei Arten von Ankern: das Zirkumflex `^`
+stimmt mit dem Anfang, das Dollarzeichen `$` mit dem Ende der Eingabe überein.  
 
-### 2.8.1 Caret
+### 2.8.1 Zirkumflex
 
-Caret `^` symbol is used to check if matching character is the first character
-of the input string. If we apply the following regular expression `^a` (if a is
-the starting symbol) to input string `abc` it matches `a`. But if we apply
-regular expression `^b` on above input string it does not match anything.
-Because in input string `abc` "b" is not the starting symbol. Let's take a look
-at another regular expression `^(T|t)he` which means: uppercase character `T` or
-lowercase character `t` is the start symbol of the input string, followed by
-lowercase character `h`, followed by lowercase character `e`.
+Das Zirkumflex `^` (eng. *caret*) wird benutzt um zu überprüfen, ob der Teilausdruck mit dem Anfang der Zeichenkette übereinstimmt.
+Wenn wir den regulären Ausdruck `^a` auf die Eingabe `abc` anwenden, stimmt er mit `a` überein. 
+Aber wenn wir auf die gleiche Eingabe den Ausdruck `^b` anwenden, gibt es keine Übereinstimmungen, weil in der Zeichenkette `abc` kein "b"
+am Anfang steht. Schauen wir uns einen anderen Ausdruck an: `^(T|t)he`. Dieser bedeutet: kleines `t` oder großes `T` am Anfang der Eingabe,
+gefolgt von `h`, gefolgt von `e`.
 
 
 "(T|t)he" => The car is parked in the garage.
@@ -342,10 +327,8 @@ lowercase character `h`, followed by lowercase character `e`.
 
 ### 2.8.2 Dollar
 
-Dollar `$` symbol is used to check if matching character is the last character
-of the input string. For example, regular expression `(at\.)$` means: a
-lowercase character `a`, followed by lowercase character `t`, followed by a `.`
-character and the matcher must be end of the string.
+Das Dollarzeichen `$` wird benutzt um zu überprüfen, ob der Teilausdruck mit dem Ende der Zeichenkette übereinstimmt.
+Der reguläre Ausdruck `(at\.)$` etwa bedeutet: `a`, gefolgt von `t` und dann `.` am Ende der Eingabe.
 
 
 "(at\.)" => The fat cat. sat. on the mat.
@@ -359,53 +342,47 @@ character and the matcher must be end of the string.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/t0AkOd/1)
 
-##  3. Shorthand Character Sets
+##  3. Vordefinierte Zeichenklassen
 
-Regular expression provides shorthands for the commonly used character sets,
-which offer convenient shorthands for commonly used regular expressions. The
-shorthand character sets are as follows:
+Reguläre Ausdrücke haben Kürzel für die am häufigsten benötigten Zeichenklassen, was viele Ausdrücke vereinfacht und kürzer macht.
+Das sind die vordefinierten Zeichenklassen:
 
 |Shorthand|Description|
 |:----:|----|
-|.|Any character except new line|
-|\w|Matches alphanumeric characters: `[a-zA-Z0-9_]`|
-|\W|Matches non-alphanumeric characters: `[^\w]`|
-|\d|Matches digit: `[0-9]`|
-|\D|Matches non-digit: `[^\d]`|
-|\s|Matches whitespace character: `[\t\n\f\r\p{Z}]`|
-|\S|Matches non-whitespace character: `[^\s]`|
+|.|Beliebiges Zeichen außer Zeilenumbruch|
+|\w|Stimmt mit alphanumerischen Zeichen überein: `[a-zA-Z0-9_]`|
+|\W|Stimmt mit nicht-alphanumerischen Zeichen überein: `[^\w]`|
+|\d|Stimmt mit Ziffern überein: `[0-9]`|
+|\D|Stimmt mit Zeichen, die keine Ziffern sind überein: `[^\d]`|
+|\s|Stimmt mit Leerraum überein: `[\t\n\f\r\p{Z}]`|
+|\S|Stimmt mit allem außer Leerraum überein: `[^\s]`|
 
 ## 4. Lookaround
 
-Lookbehind and lookahead (also called lookaround) are specific types of
-***non-capturing groups*** (Used to match the pattern but not included in matching
-list). Lookarounds are used when we have the condition that this pattern is
-preceded or followed by another certain pattern. For example, we want to get all
-numbers that are preceded by `$` character from the following input string
-`$4.44 and $10.88`. We will use following regular expression `(?<=\$)[0-9\.]*`
-which means: get all the numbers which contain `.` character and  are preceded
-by `$` character. Following are the lookarounds that are used in regular
-expressions:
+Lookbehind ("nach hinten sehend") und Lookahead ("vorausschauend") (auch Lookaround ("Umsehen") genannt) sind besondere Arten von **Gruppierungen ohne Rückwärtsreferenz**
+(zur Erinnerung: das sind Gruppierungen, die zwar mit dem Muster übereinstimmen, aber sich die Übereinstimmung nicht "merken").
+Sie werden in Situationen verwendet, wo wir ein Muster einfangen wollen, dem andere Muster folgen oder vorhergehen.
+Zum Beispiel wollen wir alle Zahlen aus der Zeichenkette `$4.44 and $10.88`, vor denen ein Dollarzeichen `$` steht. Wir benutzen dafür den folgenden regulären Audruck:
+`(?<=\$)[0-9.]*`. Das heißt: Stimme mit allen Zeichenketten überein, die Ziffern `0-9` oder Punkte `.` enthalten und die einem Dollarzeichen `$` folgen.
 
-|Symbol|Description|
+Das sind die Lookarounds, die es gibt:
+
+|Symbol|Name|
 |:----:|----|
-|?=|Positive Lookahead|
-|?!|Negative Lookahead|
-|?<=|Positive Lookbehind|
-|?
 "(T|t)he(?=\sfat)" => The fat cat sat on the mat.
@@ -413,15 +390,11 @@ or `the` which are followed by the word `fat`.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/IDDARt/1)
 
-### 4.2 Negative Lookahead
+### 4.2 Negativer Lookahead
 
-Negative lookahead is used when we need to get all matches from input string
-that are not followed by a pattern. Negative lookahead is defined same as we define
-positive lookahead but the only difference is instead of equal `=` character we
-use negation `!` character i.e. `(?!...)`. Let's take a look at the following
-regular expression `(T|t)he(?!\sfat)` which means: get all `The` or `the` words
-from input string that are not followed by the word `fat` precedes by a space
-character.
+Negative Lookaheads werden verwendet, um alle Übereinstimmungen in einer Zeichenkette zu bekommen, auf die **nicht** ein bestimmtes Muster folgt.
+Ein Negativer Lookahead wird wie ein positiver Lookahead definiert, nur dass statt einem Gleichheitszeichen ein Ausrufezeichen `!` benutzt wird, d.h.
+`(?!...)`. Aus dem regulären Ausdruck `(T|t)he(?!\sfat)` folgt somit: alle `The` oder `the`, auf die **kein** Leerzeichen und das Wort `fat` folgt, stimmen überein.
 
 
 "(T|t)he(?!\sfat)" => The fat cat sat on the mat.
@@ -429,12 +402,11 @@ character.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/V32Npg/1)
 
-### 4.3 Positive Lookbehind
+### 4.3 Positiver Lookbehind
 
-Positive lookbehind is used to get all the matches that are preceded by a
-specific pattern. Positive lookbehind is denoted by `(?<=...)`. For example, the
-regular expression `(?<=(T|t)he\s)(fat|mat)` means: get all `fat` or `mat` words
-from input string that are after the word `The` or `the`.
+Positive Lookbehinds werden verwendet, um alle Übereinstimmungen in einer Zeichenkette zu bekommen, denen ein bestimmtes Muster vorhergeht.
+Postive Lookbehinds werden mit `(?<=...)` notiert. Der reguläre Ausdruck `(?<=(T|t)he\s)(fat|mat)` zum Beispiel bedeutet: alle `fat` oder `mat`, 
+die nach `The ` oder `the ` kommen, stimmen überein.
 
 
 "(?<=(T|t)he\s)(fat|mat)" => The fat cat sat on the mat.
@@ -442,12 +414,11 @@ from input string that are after the word `The` or `the`.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/avH165/1)
 
-### 4.4 Negative Lookbehind
+### 4.4 Negativer Lookbehind
 
-Negative lookbehind is used to get all the matches that are not preceded by a
-specific pattern. Negative lookbehind is denoted by `(?
 "(?<!(T|t)he\s)(cat)" => The cat sat on cat.
@@ -455,19 +426,22 @@ string that are not after the word `The` or `the`.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/8Efx5G/1)
 
-## 5. Flags
+## 5. Modifikatoren
 
-Flags are also called modifiers because they modify the output of a regular
-expression. These flags can be used in any order or combination, and are an
-integral part of the RegExp.
+Modifikatoren (eng. *flags* oder *modifiers*) verändern die Ausgabe eines regulären Ausdrucks. Sie können in beliebiger Kombination oder Reihenfolge 
+genutzt werden und sind ein integraler Bestandteil regulärer Ausdrücke.
 
-|Flag|Description|
+
+|Modifikator|Beschreibung|
 |:----:|----|
-|i|Case insensitive: Sets matching to be case-insensitive.|
-|g|Global Search: Search for a pattern throughout the input string.|
-|m|Multiline: Anchor meta character works on each line.|
+|i|Schreibungsunabhängig: Unterschiede bei Groß- und Kleinschreibung in den Mustern werden ignoriert.|
+|g|Globale Suche: Die Suche geht durch die gesamte Eingabe.|
+|m|Mehrzeilig: Anker-Metazeichen funktionieren für Anfang/Ende jeder Zeile.|
 
-### 5.1 Case Insensitive
+### 5.1 Schreibungsunabhängig
+
+Der `i` Modifikator wird benutzt, um schreibungsunbhängige Übereinstimmungen zu finden. Zum Beispiel heißt der reguläre Ausdruck
+`/The/gi`: großes `T`
 
 The `i` modifier is used to perform case-insensitive matching. For example, the
 regular expression `/The/gi` means: uppercase letter `T`, followed by lowercase

From 18293bc13cc18c39bd6ac6ce4c78147dd0aba067 Mon Sep 17 00:00:00 2001
From: JohnnyJayJay 
Date: Thu, 25 Jun 2020 19:14:32 +0200
Subject: [PATCH 12/16] Add information about i flag

---
 translations/README-de.md | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/translations/README-de.md b/translations/README-de.md
index fd85286..f2d5536 100644
--- a/translations/README-de.md
+++ b/translations/README-de.md
@@ -441,14 +441,9 @@ genutzt werden und sind ein integraler Bestandteil regulärer Ausdrücke.
 ### 5.1 Schreibungsunabhängig
 
 Der `i` Modifikator wird benutzt, um schreibungsunbhängige Übereinstimmungen zu finden. Zum Beispiel heißt der reguläre Ausdruck
-`/The/gi`: großes `T`
-
-The `i` modifier is used to perform case-insensitive matching. For example, the
-regular expression `/The/gi` means: uppercase letter `T`, followed by lowercase
-character `h`, followed by character `e`. And at the end of regular expression
-the `i` flag tells der reguläre Ausdruck engine to ignore the case. As you can
-see we also provided `g` flag because we want to search for the pattern in the
-whole input string.
+`/The/gi`: großes `T`, gefolgt von `h`, dann `e`. Und am Ende des Ausdrucks ist der `i` Modifikator zu finden, welcher der Maschine 
+zu verstehen gibt, dass Groß- und Kleinschreibung ignoriert werden soll. Wie zu sehen ist, wird auch der `g` Modifikator benutzt,
+da wir die gesamte Eingabe nach dem Muster absuchen wollen.
 
 
 "The" => The fat cat sat on the mat.
@@ -462,7 +457,7 @@ whole input string.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/ahfiuh/1)
 
-### 5.2 Global search
+### 5.2 Globale Suche
 
 The `g` modifier is used to perform a global match (find all matches rather than
 stopping after the first match). For example, der reguläre Ausdruck`/.(at)/g`

From c63cca4d220b1a32f5b6133d9a34e56af5869e58 Mon Sep 17 00:00:00 2001
From: JohnnyJayJay <39348311+JohnnyJayJay@users.noreply.github.com>
Date: Fri, 26 Jun 2020 08:37:08 +0200
Subject: [PATCH 13/16] finish remaining translation

---
 translations/README-de.md | 44 ++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 24 deletions(-)

diff --git a/translations/README-de.md b/translations/README-de.md
index f2d5536..7db7222 100644
--- a/translations/README-de.md
+++ b/translations/README-de.md
@@ -442,7 +442,7 @@ genutzt werden und sind ein integraler Bestandteil regulärer Ausdrücke.
 
 Der `i` Modifikator wird benutzt, um schreibungsunbhängige Übereinstimmungen zu finden. Zum Beispiel heißt der reguläre Ausdruck
 `/The/gi`: großes `T`, gefolgt von `h`, dann `e`. Und am Ende des Ausdrucks ist der `i` Modifikator zu finden, welcher der Maschine 
-zu verstehen gibt, dass Groß- und Kleinschreibung ignoriert werden soll. Wie zu sehen ist, wird auch der `g` Modifikator benutzt,
+zu verstehen gibt, dass Groß- und Kleinschreibung ignoriert werden sollen. Wie zu sehen ist, wird auch der `g` Modifikator benutzt,
 da wir die gesamte Eingabe nach dem Muster absuchen wollen.
 
 
@@ -459,11 +459,10 @@ da wir die gesamte Eingabe nach dem Muster absuchen wollen.
 
 ### 5.2 Globale Suche
 
-The `g` modifier is used to perform a global match (find all matches rather than
-stopping after the first match). For example, der reguläre Ausdruck`/.(at)/g`
-means: any character except new line, followed by lowercase character `a`,
-followed by lowercase character `t`. Because we provided `g` flag at the end of
-der reguläre Ausdruck now it will find all matches in the input string, not just the first one (which is the default behavior).
+Der `g` Modifikator wird benutzt, um eine globale Suche durchzuführen (alle Übereinstimmungen finden, nicht nach der ersten aufhören).
+Zum Beispiel heißt der reguläre Ausdruck `/.(at)/g`: ein beliebiges Zeichen (außer Zeilenumbruch), gefolgt von `a`, gefolgt von `t`.
+Weil wir den `g` Modifikator angegeben haben, findet der reguläre Ausdruck nun alle Übereinstimmungen in der Eingabe, nicht nur die erste
+(was das Standardverhalten ist).
 
 
 "/.(at)/" => The fat cat sat on the mat.
@@ -477,15 +476,12 @@ der reguläre Ausdruck now it will find all matches in the input string, not jus
 
 [Teste den regulären Ausdruck](https://regex101.com/r/dO1nef/1)
 
-### 5.3 Multiline
+### 5.3 Mehrzeilig
 
-The `m` modifier is used to perform a multi-line match. As we discussed earlier
-anchors `(^, $)` are used to check if pattern is the beginning of the input or
-end of the input string. But if we want that anchors works on each line we use
-`m` flag. For example, der reguläre Ausdruck `/at(.)?$/gm` means: lowercase
-character `a`, followed by lowercase character `t`, optionally anything except
-new line. And because of `m` flag now regular expression engine matches pattern
-at the end of each line in a string.
+Der `m` Modifikator wird benutzt, um eine mehrzeilige Suche durchzuführen. Wie zuvor erwähnt werden Anker `(^, $)` genutzt, um zu überprüfen,
+ob ein Muster dem Anfang oder dem Ende der Eingabe entspricht. Wenn wir stattdessen wollen, dass Anker zeilenweise funktionieren, nutzen wir den `m`
+Modifikator. Zum Beispiel bedeutet der reguläre Ausdruck `/at(.)?$/gm`: `a`, gefolgt von `t`, dann optional ein beliebiges Zeichen außer 
+Zeilenumbruch. Wegen des `m` Modifikators wird das Muster nun auf das Ende jeder Zeile statt nur das Ende der gesamten Eingabe angewandt.
 
 
 "/.at(.)?$/" => The fat
@@ -503,9 +499,10 @@ at the end of each line in a string.
 
 [Teste den regulären Ausdruck](https://regex101.com/r/E88WE2/1)
 
-## 6. Greedy vs lazy matching
-By default regex will do greedy matching , means it will match as long as
-possible. we can use `?` to match in lazy way means as short as possible
+## 6. Gier vs Faulheit
+
+Standardmäßig finden reguläre Ausdrücke Übereinstimmungen mit Gier (eng. *greed*), d.h. es wird nach den längsten Übereinstimmungen gesucht. 
+Mit `?` können wir faul (eng. *lazy*) suchen, d.h. es wird nach den kürzesten Übereinstimmungen gesucht.
 
 
 "/(.*at)/" => The fat cat sat on the mat. 
@@ -519,14 +516,13 @@ possible. we can use `?` to match in lazy way means as short as possible [Teste den regulären Ausdruck](https://regex101.com/r/AyAdgJ/2) +## Beitragen -## Contribution +* Öffne pull requests mit Verbesserungen +* Diskutiere Ideen in issues +* Erzähl es anderen +* Gebt Rückmeldung [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/ziishaned.svg?style=social&label=Follow%20%40ziishaned)](https://twitter.com/ziishaned) -* Open pull request with improvements -* Discuss ideas in issues -* Spread the word -* Reach out with any feedback [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/ziishaned.svg?style=social&label=Follow%20%40ziishaned)](https://twitter.com/ziishaned) - -## License +## Lizenz MIT © [Zeeshan Ahmad](https://twitter.com/ziishaned) From f0a00dc5c93139975cb4dd3d0e9eb75f8dc33cbb Mon Sep 17 00:00:00 2001 From: JohnnyJayJay <39348311+JohnnyJayJay@users.noreply.github.com> Date: Fri, 26 Jun 2020 08:47:43 +0200 Subject: [PATCH 14/16] Adjust table of contents and a few titles --- translations/README-de.md | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/translations/README-de.md b/translations/README-de.md index 7db7222..5fd8507 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -22,7 +22,7 @@ * [Русский](../translations/README-ru.md) * [Tiếng Việt](../translations/README-vn.md) -## Was sind reguläre Ausdrücke +## Was sind Reguläre Ausdrücke? > Ein regulärer Ausdruck ist eine Gruppe von Buchstaben und Symbolen, die benutzt werden um ein spezifisches Muster in einem Text zu finden Ein regulärer Ausdruch ist ein Muster, das mit einem zu durchsuchenden Text von links nach rechts abgeglichen wird. Die Bezeichnung @@ -41,35 +41,35 @@ den Benutzernamen zu überprüfen: Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, `jo-hn_doe` und `john12_as`. Der Eingabe `Jo` wird nicht akzeptiert, da sie einen Großbuchstaben enthält und zu kurz ist. -## Table of Contents +## Inhaltsverzeichnis -- [Basis Vergleiche](#1-basis-vergleiche) -- [Sonderzeichen](#2-sonderzeichen) +- [Einfache Muster](#1-einfache-muster) +- [Metazeichen](#2-metazeichen) - [Punkt](#21-punkt) - [Zeichenklasse](#22-zeichenklasse) - [Negierte Zeichenklasse](#221-negierte-zeichenklasse) - [Wiederholungen](#23-wiederholungen) - - [Stern *](#231-der-stern) - - [Plus +](#232-das-plus) - - [Fragezeichen ?](#233-das-fragezeichen) + - [Stern *](#231-stern) + - [Plus +](#232-plus) + - [Fragezeichen ?](#233-fragezeichen) - [Geschweifte Klammern {}](#24-geschweifte-klammern) - - [Gruppierung](#25-gruppierung) + - [Gruppierung ()](#25-gruppierung) - [Alternation |](#26-alternation) - - [Auswertung von Sonderzeichen](#27-auswertung-von-sonderzeichen) + - [Escaping \](#27-escaping) - [Anker](#28-anker) - - [Caret ^](#281-caret) + - [Zirkumflex ^](#281-zirkumflex) - [Dollar $](#282-dollar) -- [Kurzschreibweisen](#3-kurzschreibweisen) -- [Umschauen](#4-umschauen) - - [Positives Vorrausschauen](#41-positives-vorausschauen) - - [Negatives Vorrausschauen](#42-negatives-vorausschauen) - - [Positives Zurückschauen](#43-positives-zurückschauen) - - [Negatives Zurückschauen](#44-negatives-zurückschauen) -- [Steuerparameter](#5-steuerparameter) - - [Groß-/Kleinschreibung](#51-groß-kleinschreibung) +- [Vordefinierte Zeichenklassen](#3-vordefinierte-zeichenklassen) +- [Lookaround](#4-lookaround) + - [Positiver Lookahead](#41-positiver-lookahead) + - [Negativer Lookahead](#42-negativer-lookahead) + - [Positiver Lookbehind](#43-positiver-lookbehind) + - [Negativer Lookbehind](#44-negativer-lookbehind) +- [Modifikatoren](#5-modifikatoren) + - [Schreibungsunabhängig i](#51-schreibungsunbhängig) - [Globale Suche](#52-globale-suche) - [Mehrzeilig](#53-mehrzeilig) -- [Gierige oder faule Übereinstimmung](#6-gierige-oder-faule-übereinstimmung) +- [Gierige vs Faule Übereinstimmung](#6-gierige-vs-faule-übereinstimmung) ## 1. Einfache Muster @@ -151,7 +151,7 @@ Im Allgemeinen stellt das Zirkumflex `^` den Anfang einer Zeichenkette dar. Wenn Die Metazeichen `+`, `*` und `?` bieten einen einfachen Weg, anzugeben, wie oft sich ein bestimmter Teilausdruck wiederholen soll. Sie gehören damit zu den sogenannten "Quantifizierern" (eng. *quantifier*). Sie können sich je nach Situation unterschiedlich verhalten. -### 2.3.1 Der Stern +### 2.3.1 Stern Das Symbol `*` stimmt mit beliebig vielen Wiederholungen des vorhergehenden Teilausdrucks überein. Der Ausdruck `a*` heißt: null, eins oder mehrere `a`s in Folge. Da sich der Stern auf Teilausdrücke bezieht, kann er auch bspw. hinter einer Zeichenklasse stehen @@ -175,7 +175,7 @@ gefolgt vom Buchstaben `t` und schließlich gefolgt von null oder mehreren Leerz [Teste den regulären Ausdruck](https://regex101.com/r/gGrwuz/1) -### 2.3.2 Das Plus +### 2.3.2 Plus Das `+`-Symbol stimmt mit einer oder mehr Wiederholungen des vorhergehenden Teilausdrucks überein. Der reguläre Ausdruck `c.+t` bedeutet: Buchstabe `c`, gefolgt von mindestens einem beliebigen Zeichen, gefolgt vom Buchstaben `t`. Das `t` ist dabei @@ -187,7 +187,7 @@ das letzte `t` in der hier zu sehenden Übereinstimmung, wobei es hier auch weit [Teste den regulären Ausdruck](https://regex101.com/r/Dzf9Aa/1) -### 2.3.3 Das Fragezeichen +### 2.3.3 Fragezeichen In regulären Ausdrücken sorgt das Metazeichen `?` dafür, dass der vorhergehende Teilausdruck optional wird. Somit stimmt es mit null oder einer Übereinstimmung des Teilausdrucks überein. @@ -283,7 +283,7 @@ gesetzt wurden. [Teste den regulären Ausdruck](https://regex101.com/r/fBXyX0/1) -## 2.7 Escape +## 2.7 Escaping Der Backslash `\` wird in regulären Ausdrücken verwendet, um die besondere Bedeutung des folgenden Zeichens aufzuheben (eng. *escape*) oder ihm eine besondere Bedeutung zu verleihen (s. [Vordefinierte Zeichenklassen](#3-vordefinierte-zeichenklassen)). @@ -359,7 +359,7 @@ Das sind die vordefinierten Zeichenklassen: ## 4. Lookaround -Lookbehind ("nach hinten sehend") und Lookahead ("vorausschauend") (auch Lookaround ("Umsehen") genannt) sind besondere Arten von **Gruppierungen ohne Rückwärtsreferenz** +Lookbehind ("zurückschauen") und Lookahead ("vorausschauen") (auch Lookaround ("Umsehen") genannt) sind besondere Arten von **Gruppierungen ohne Rückwärtsreferenz** (zur Erinnerung: das sind Gruppierungen, die zwar mit dem Muster übereinstimmen, aber sich die Übereinstimmung nicht "merken"). Sie werden in Situationen verwendet, wo wir ein Muster einfangen wollen, dem andere Muster folgen oder vorhergehen. Zum Beispiel wollen wir alle Zahlen aus der Zeichenkette `$4.44 and $10.88`, vor denen ein Dollarzeichen `$` steht. Wir benutzen dafür den folgenden regulären Audruck: @@ -499,7 +499,7 @@ Zeilenumbruch. Wegen des `m` Modifikators wird das Muster nun auf das Ende jeder [Teste den regulären Ausdruck](https://regex101.com/r/E88WE2/1) -## 6. Gier vs Faulheit +## 6. Gierige vs Faule Übereinstimmung Standardmäßig finden reguläre Ausdrücke Übereinstimmungen mit Gier (eng. *greed*), d.h. es wird nach den längsten Übereinstimmungen gesucht. Mit `?` können wir faul (eng. *lazy*) suchen, d.h. es wird nach den kürzesten Übereinstimmungen gesucht. From 0b5391fbd48ddd8f5ae1c26836a52cff4755c1a9 Mon Sep 17 00:00:00 2001 From: JohnnyJayJay <39348311+JohnnyJayJay@users.noreply.github.com> Date: Fri, 26 Jun 2020 08:52:43 +0200 Subject: [PATCH 15/16] Make contributing section grammar consistent --- translations/README-de.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/README-de.md b/translations/README-de.md index 5fd8507..787e60f 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -521,7 +521,7 @@ Mit `?` können wir faul (eng. *lazy*) suchen, d.h. es wird nach den kürzesten * Öffne pull requests mit Verbesserungen * Diskutiere Ideen in issues * Erzähl es anderen -* Gebt Rückmeldung [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/ziishaned.svg?style=social&label=Follow%20%40ziishaned)](https://twitter.com/ziishaned) +* Gib Rückmeldung [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/ziishaned.svg?style=social&label=Follow%20%40ziishaned)](https://twitter.com/ziishaned) ## Lizenz From daf704e8c1286e37b37059b57eaf7c7601fc9de1 Mon Sep 17 00:00:00 2001 From: JohnnyJayJay <39348311+JohnnyJayJay@users.noreply.github.com> Date: Fri, 26 Jun 2020 09:04:15 +0200 Subject: [PATCH 16/16] Fix old grammar in early sections --- translations/README-de.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translations/README-de.md b/translations/README-de.md index 787e60f..f55f728 100644 --- a/translations/README-de.md +++ b/translations/README-de.md @@ -24,22 +24,21 @@ ## Was sind Reguläre Ausdrücke? -> Ein regulärer Ausdruck ist eine Gruppe von Buchstaben und Symbolen, die benutzt werden um ein spezifisches Muster in einem Text zu finden +> Ein regulärer Ausdruck ist eine Gruppe von Buchstaben und Symbolen, die benutzt werden um ein bestimmtes Muster in einem Text zu finden. Ein regulärer Ausdruch ist ein Muster, das mit einem zu durchsuchenden Text von links nach rechts abgeglichen wird. Die Bezeichnung -"Regulärer Ausdruck" ist in der Praxis unüblich und stattdessen wird häufig die Englische Abkürzung "Regex" verwendet. Reguläre -Ausdrücke werden verwendet um Fragemente eines Textes zu ersetzen, Formulare zu validieren, Segmente eines Textes anhand eines +"Regulärer Ausdruck" ist in der Praxis unüblich und stattdessen wird häufig die Englische Abkürzung "Regex" oder "RegExp" (*regular expression*) verwendet. Reguläre +Ausdrücke werden verwendet, um Fragemente eines Textes zu ersetzen, Formulare zu validieren, Segmente eines Textes anhand eines Musters zu extrahieren und für vieles mehr. -Angenommen Du schreibst eine Applikation und möchtest die Regeln definieren, nach denen ein Benutzer seinen Benutzernamen auswählen +Angenommen, Du schreibst eine Anwendung und möchtest die Regeln definieren, nach denen ein Benutzer seinen Benutzernamen auswählen kann. Wir möchten festlegen, dass der Benutzernamen Buchstaben, Ziffern, Unter- und Bindestriche beinhalten darf. Außerdem wollen -wir die Anzahl der Zeichen limitieren, damit der Name nicht unlesbar wird. Dazu verwenden wir den folgenden regulären Ausdruck um -den Benutzernamen zu überprüfen: +wir die Anzahl der Zeichen limitieren, damit der Name nicht unlesbar wird. Dazu verwenden wir den folgenden regulären Ausdruck:

Regular expression

-Der abgebildete reguläre Ausdruck erlaubt bspw. folgende Eingaben `john_doe`, `jo-hn_doe` und `john12_as`. Der Eingabe `Jo` wird nicht akzeptiert, da sie einen Großbuchstaben enthält und zu kurz ist. +Der abgebildete reguläre Ausdruck erlaubt bspw. die Eingaben `john_doe`, `jo-hn_doe` und `john12_as`. Der Eingabe `Jo` wird nicht akzeptiert, da sie einen Großbuchstaben enthält und zu kurz ist. ## Inhaltsverzeichnis @@ -81,7 +80,8 @@ Ein regulärer Ausdruck ist einfach nur ein Muster von Zeichen, welches für ein [Teste den regulären Ausdruck](https://regex101.com/r/dmRygT/1) -Der reguläre Ausdruck `123` entspricht der Zeichenkette `123`. Dieser reguläre Ausdruck wird auf Übereinstimmung mit einer Zeichenkette überprüft, indem jedes Zeichen in dem regulären Ausdruck nacheinander mit den Zeichen in der Zeichenkette verglichen wird. Reguläre Ausdrücke sind normalerweise case sensitiv, Beachtung von Groß-/Kleinschreibung, sodass der Ausdruck `The` nicht mit der Zeichenkette `the` überein stimmen würde. +Der reguläre Ausdruck `123` entspricht der Zeichenkette `123`. Auf Übereinstimmung mit einer Zeichenkette wird er überprüft, indem jedes Zeichen in dem regulären Ausdruck nacheinander mit jedem Zeichen der Zeichenkette verglichen wird. +Reguläre Ausdrücke berücksichtigen normalerweise Groß- und Kleinschreibung, sodass etwa der Ausdruck `The` nicht mit der Zeichenkette `the` übereinstimmen würde.
 "The" => The fat cat sat on the mat.