File tree Expand file tree Collapse file tree 9 files changed +43
-35
lines changed Expand file tree Collapse file tree 9 files changed +43
-35
lines changed Original file line number Diff line number Diff line change 1+ This image has been copied from xkcd.com
2+
3+ - https://imgs.xkcd.com/comics/regular_expressions.png
4+ - https://www.xkcd.com/208/
5+
6+ License:
7+ - https://creativecommons.org/licenses/by-nc/2.5/
8+ - This file is licensed under Creative Commons Attribution-NonCommercial 2.5 Generic (CC BY-NC 2.5) License. https://creativecommons.org/licenses/by-nc/2.5/
Original file line number Diff line number Diff line change 1010 test if the input of a program is correct, and check if the users made mistakes.
1111</ p >
1212< p >
13- < a target ="_blank " href ="https://www.xkcd.com/208/ "> < img src ="https://imgs.xkcd.com/comics/regular_expressions.png "> </ a >
13+ < a target ="_blank " href ="../extern/xkcd/README.md ">
14+ < img src ="../extern/xkcd/regular-expressions.png ">
15+ </ a >
1416</ p >
1517< script type ="text/javascript ">
1618 window . addEventListener ( "load" , function ( ) {
Original file line number Diff line number Diff line change 55---
66< p >
77 You can find words by wrapping them in spaces.
8- Try to find the word "geben ", not the word "umgeben " or "vergebens "
8+ Try to find the word "day ", not the word "someday " or "birthdays "
99 by using the word with spaces.
1010</ p >
1111< div class ="playfield ">
1212 < input type ="text " value ="" class ="regex " reference =" geben ">
1313 < div class ="message "> </ div >
1414 < ul class ="examples ">
15- < li > Wir sind umgeben von </ li >
16- < li > Leuten, die gerne was geben, </ li >
17- < li > wenn es nicht vergebens ist. </ li >
15+ < li > We have to go shopping someday. </ li >
16+ < li > Another day, I don't have time right now. </ li >
17+ < li > All these birthdays are killing me! </ li >
1818 </ ul >
19- </ div >
19+ </ div >
Original file line number Diff line number Diff line change 88 Many programming languages use the character "|" as a replacement for "or".
99</ p >
1010< p >
11- In the following list, you can filter all villages
12- which contain < span class ="regex "> hausen </ span > or < span class ="regex "> roda </ span >
13- by writing < span class ="regex "> hausen|roda </ span > .
14- I read < span class ="regex "> hausen|roda </ span > like "hausen or roda ".
11+ In the following list, you can filter all cities
12+ which contain < span class ="regex "> ham </ span > or < span class ="regex "> New </ span >
13+ by writing < span class ="regex "> ham|New </ span > .
14+ I read < span class ="regex "> ham|New </ span > like "ham or New ".
1515 To write the character < span class ="regex "> |</ span > ,
1616 you can use the key next to the return key on the right side of the keyboard.
1717</ p >
1818< div class ="playfield ">
19- < input type ="text " value ="" class ="regex " reference ="hausen|roda ">
19+ < input type ="text " value ="" class ="regex " reference ="ham|New ">
2020 < div class ="message "> </ div >
2121 < ul class ="examples ">
22- < li > Waltershausen </ li >
23- < li > Friedrichroda </ li >
24- < li > Tabarz </ li >
25- < li > Fischbach </ li >
26- < li > Zeulenroda </ li >
27- < li > Vieselbach </ li >
28- < li > Sondershausen </ li >
29- < li > Sömmerda </ li >
22+ < li > Nottingham </ li >
23+ < li > Newcastle </ li >
24+ < li > Birmingham </ li >
25+ < li > New York </ li >
26+ < li > Northampton </ li >
27+ < li > London </ li >
28+ < li > Hampstead </ li >
29+ < li > New Orleans </ li >
3030 </ ul >
31- </ div >
31+ </ div >
Original file line number Diff line number Diff line change 11---
22layout: step
3- title: sets
3+ title: Sets
44lang: en
55---
66< p >
Original file line number Diff line number Diff line change 1818 < span class ="regex "> .*</ span > can be used if you do not care about some content.
1919 </ li >
2020 < li >
21- < span class ="regex "> \w</ span > is for letters in < strong > w</ strong > ords.
21+ < span class ="regex "> \w</ span > is for letters in < strong > w</ strong > ords.
2222 < span class ="regex "> \w</ span > is the same as < span class ="regex "> [0-9a-zA-Z]_</ span > .
2323 </ li >
2424 < li >
2929 you can use the capital letter e.g. < span class ="regex "> \S</ span > .
3030</ p >
3131< p >
32- The following text is from "Die Zwölf Weihnachtsfeiertage " by Gerhard Schone
33- [< a target ="_blank " href ="http ://www.sing365.com/music/lyric.nsf/Die-Zw%C3%B6lf-Weihnachtsfeiertage- lyrics-Gerhard-Schone/D41B005B291D4040482578D4001AB755 "> source</ a > ].
32+ The following text is from "The Twelve Days of Christmas " by Harry Belafonte
33+ [< a target ="_blank " href ="https ://www.sing365.com/lyrics/The-Twelve-Days-of-Christmas- lyrics-Harry-Belafonte/BC1DF2E550EB342CA3330E17C8693FEA "> source</ a > ].
3434 Here, animals are counted.
3535 Find all lines in which a number is followed by space followed by a word.
3636</ p >
3737< div class ="playfield ">
3838 < input type ="text " value ="" class ="regex " reference ="\d\s\w ">
3939 < div class ="message "> </ div >
4040 < ul class ="examples ">
41- < li > Am 5. Weihnachtstag </ li >
42- < li > schenkte mir mein lieber Schatz </ li >
43- < li > 5 Füllhörner </ li >
44- < li > 4 Pfirsiche </ li >
45- < li > 3 Drosselchen </ li >
46- < li > 2 Zwiebelchen </ li >
47- < li > und für’n Birnenbaum 1 Spatz .</ li >
41+ < li > On the 5th day of Christmas </ li >
42+ < li > my true love sent to me </ li >
43+ < li > 5 golden rings </ li >
44+ < li > 4 calling birds </ li >
45+ < li > 3 French hens </ li >
46+ < li > 2 turle doves </ li >
47+ < li > and a partridge in a pear tree .</ li >
4848 </ ul >
49- </ div >
49+ </ div >
Original file line number Diff line number Diff line change 44lang: en
55---
66< p >
7- HTML ist die Sprache, mit der Webseiten geschrieben werden.
87 HTML is the language used to write websites.
98 HTML tags start with < span class ="regex "> <</ span > end and with < span class ="regex "> ></ span > .
109 in between there is text.
3534 At the bottom you can find the regular expressions.
3635 The language HTML can not be described using a regular expression.
3736 But, parts if the language like tags can be described using a regular expression.
38- </ p >
37+ </ p >
Original file line number Diff line number Diff line change 1-
21---
32layout: step
43title: Wiederholungen Zählen
You can’t perform that action at this time.
0 commit comments