Skip to content

Commit 0355cce

Browse files
authored
fixed regex rendering for three dots
from \.{3} to \\.{3}
1 parent f8fb60d commit 0355cce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorial/tutorial-english.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,11 +1258,11 @@ foreach my $string ( '1.2', '0..2,5.6,8', '1,2,.,3', '.', '1.', '.1' ){
12581258
}
12591259

12601260
</pre>
1261-
Also the next regex (aimed to search for three dots) in the module is not working for the very same reason; change it from <code>/[^.]+\.{3}/</code> to simply <code>/\.{3}/</code>
1261+
Also the next regex (aimed to search for three dots) in the module is not working for the very same reason; change it from <code>/[^.]+\\.{3}/</code> to simply <code>/\\.{3}/</code>
12621262

12631263
The moral? Tests are your friends! We spot, by hazard, an edge case and our code must be able to deal with it, so free as much your fantasy writing your tests. Cockroaches come from box corners.. ops, no I mean: bugs come from edge case.
12641264

1265-
Now we add some test to spot, and die, if three dots are found, with the new simpler regex <code>/\.{3}/</code> so we change the code adding the following code to the test:
1265+
Now we add some test to spot, and die, if three dots are found, with the new simpler regex <code>/\\.{3}/</code> so we change the code adding the following code to the test:
12661266

12671267
<pre>
12681268
foreach my $newstring ( '1...3', '1,3...5','...', '1...', '...2' ){

0 commit comments

Comments
 (0)