Skip to content

Commit dd61130

Browse files
committed
step 13
fixes #23
1 parent 7af2f6a commit dd61130

File tree

2 files changed

+42
-14
lines changed

2 files changed

+42
-14
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
layout: step
3+
title: Counted Repetitions
4+
lang: en
5+
---
6+
<p>
7+
You can use the <span class="regex">?</span>for matching 0 oder once.
8+
You can use the <span class="regex">*</span> for 0 to infinity and
9+
plus <span class="regex">+</span> for once to infinity.
10+
You can put the exact number of repetitions into curly braces.
11+
</p>
12+
<p>
13+
Mark the <span class="regex">lol</span>which contains exactly 8 times <span class="regex">o</span>.
14+
</p>
15+
<div class="playfield">
16+
<input type="text" value="lo{3}l" class="regex" reference="lo{8}l">
17+
<div class="message"></div>
18+
<ul class="examples">
19+
<li>loool</li>
20+
<li>looooooool</li>
21+
<li>loooooooooool</li>
22+
</ul>
23+
</div>
24+
<p>
25+
For IP addresses it would have come in handy to not copy and paste the expression so often.
26+
My regular expression for IP addresses with curly braces looks like this:
27+
<span class="regex">^(1?\d?\d|2[0-4]\d|25[0-5])(\.(1?\d?\d|2[0-4]\d|25[0-5])){3}$</span>
28+
</p>
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
---
22
layout: step
3-
title: Wiederholungen Zählen
4-
lang: de
3+
title: Counted Repetitions
4+
lang: en
55
---
66
<p>
7-
Worte bestehen aus Silben.
8-
Jede Silbe hat einen Vokal.
9-
Finde alle Wörter mit zwei Silben.
7+
Words consist of syllables.
8+
Every syllable contains a vocal.
9+
Find all words with two syllables.
1010
</p>
1111
<div class="playfield">
1212
<input type="text" value="^$" class="regex" reference="^[^aeiou]*([aeiou]+([^aeiou]+|$)){2}$">
1313
<div class="message"></div>
1414
<ul class="examples">
15-
<li>treppenstufe</li>
16-
<li>traum</li>
15+
<li>circumflex</li>
16+
<li>dream</li>
1717
<li>angel</li>
1818
<li>angst</li>
19-
<li>baumhaus</li>
20-
<li>vermengen</li>
21-
<li>hunderte</li>
22-
<li>blume</li>
23-
<li>plaumen</li>
19+
<li>honey</li>
20+
<li>mix</li>
21+
<li>hundrets</li>
22+
<li>flowers</li>
23+
<li>pineapple</li>
2424
<li>anemone</li>
2525
<li>yoga</li>
2626
</ul>
2727
</div>
2828
<p class="hint">
29-
Erstelle den regulären Ausdruck für die Vokale, dann für die Konsonanten.
30-
Das U und die Vokale am Ende müssen gesondert behandelt werden.
29+
Create a regular expression for vocals, then for consonants.
30+
The a and the vocals at the end need to be handled separately.
3131
</p>

0 commit comments

Comments
 (0)