Skip to content

Commit

Permalink
Merge pull request #196 from ldko/fix-finish-expression
Browse files Browse the repository at this point in the history
02-match-extract-strings: Fix solution and typos in Finish the expression
  • Loading branch information
sharilaster authored Oct 7, 2022
2 parents ae66032 + 85d17e1 commit fe3bd8d
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 fe3bd8d

Please sign in to comment.