Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

02-match-extract-strings: Fix solution and typos in Finish the expression #196

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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