Skip to content

Commit ff4bba8

Browse files
authored
Merge pull request #1350 from changlinli/patch-1
Fix buggy Regex definition
2 parents 56161b2 + 7b31ea8 commit ff4bba8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_tour/regular-expression-patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You can also search for groups of regular expressions using parentheses.
3535
```tut
3636
import scala.util.matching.Regex
3737
38-
val keyValPattern: Regex = "([0-9a-zA-Z-#() ]+): ([0-9a-zA-Z-#() ]+)".r
38+
val keyValPattern: Regex = "([0-9a-zA-Z- ]+): ([0-9a-zA-Z-#()/. ]+)".r
3939
4040
val input: String =
4141
"""background-color: #A03300;
@@ -53,7 +53,7 @@ for (patternMatch <- keyValPattern.findAllMatchIn(input))
5353
Here we parse out the keys and values of a String. Each match has a group of sub-matches. Here is the output:
5454
```
5555
key: background-color value: #A03300
56-
key: background-image value: url(img
56+
key: background-image value: url(img/header100.png)
5757
key: background-position value: top center
5858
key: background-repeat value: repeat-x
5959
key: background-size value: 2160px 108px

0 commit comments

Comments
 (0)