Skip to content

Commit

Permalink
Fix solution and typos in Finish the expression
Browse files Browse the repository at this point in the history
  • Loading branch information
ldko committed Dec 15, 2021
1 parent ae66032 commit 85d17e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions episodes/02-match-extract-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ Open the [swcCoC.md file](https://github.com/LibraryCarpentry/lc-data-intro/tree
{: .challenge}
> ## Finish the expression
> 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.
> 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.
> > ## Solution
> > ~~~
> > [\w.-]+\.[\w]{2,3} OR [\w.-]+\.[\w]
> > [\w.-]+\.\w{2,3} OR [\w.-]+\.\w+
> > ~~~
> > See the previous exercise for the explanation of the expression up to the `+`
> >
Expand Down

0 comments on commit 85d17e1

Please sign in to comment.