Skip to content

Commit fe3bd8d

Browse files
authored
Merge pull request #196 from ldko/fix-finish-expression
02-match-extract-strings: Fix solution and typos in Finish the expression
2 parents ae66032 + 85d17e1 commit fe3bd8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

episodes/02-match-extract-strings.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ Open the [swcCoC.md file](https://github.com/LibraryCarpentry/lc-data-intro/tree
122122
{: .challenge}
123123
124124
> ## Finish the expression
125-
> The string after the "@" could contain any kind of word character, special character or digit in any combination and length as well as the dash. In addition, we know that it will with some characters after a period (`.`). Most common domain names have two or three characters, but many more are now possible. Find the latest list [here](http://stats.research.icann.org/dns/tld_report/). What expression would capture this? Hint: the `.` is also a regex expression, so you'll have to use the escape `\` to express a literal period. Note: for the string after the period, we did not try to match a character, since those rarely appear in the characters after the period at the end of an email address.
125+
> The string after the "@" could contain any kind of word character, special character or digit in any combination and length as well as the dash. In addition, we know that it will have some characters after a period (`.`). Most common domain names have two or three characters, but many more are now possible. Find the latest list [here](http://stats.research.icann.org/dns/tld_report/). What expression would capture this? Hint: the `.` is also a metacharacter, so you will have to use the escape `\` to express a literal period. Note: for the string after the period, we did not try to match a `-` character, since those rarely appear in the characters after the period at the end of an email address.
126126
> > ## Solution
127127
> > ~~~
128-
> > [\w.-]+\.[\w]{2,3} OR [\w.-]+\.[\w]
128+
> > [\w.-]+\.\w{2,3} OR [\w.-]+\.\w+
129129
> > ~~~
130130
> > See the previous exercise for the explanation of the expression up to the `+`
131131
> >

0 commit comments

Comments
 (0)