Skip to content

Fix typo: "infomation" -> "information" in _tour/regular-expression-patterns.md #2671

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

Merged
merged 1 commit into from
Jan 12, 2023
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
22 changes: 11 additions & 11 deletions _tour/regular-expression-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ key: width value: 100

Moreover, regular expressions can be used as patterns (in `match` expressions) to conveniently extract the matched groups:

{% tabs regex-patterns_saveContactInfomation class=tabs-scala-version %}
{% tabs regex-patterns_saveContactInformation class=tabs-scala-version %}

{% tab 'Scala 2' for=regex-patterns_saveContactInfomation %}
{% tab 'Scala 2' for=regex-patterns_saveContactInformation %}
```scala mdoc
def saveContactInfomation(contact: String): Unit = {
def saveContactInformation(contact: String): Unit = {
import scala.util.matching.Regex

val emailPattern: Regex = """^(\w+)@(\w+(.\w+)+)$""".r
Expand All @@ -127,15 +127,15 @@ def saveContactInfomation(contact: String): Unit = {
}
}

saveContactInfomation("123-456-7890")
saveContactInfomation("[email protected]")
saveContactInfomation("2 Franklin St, Mars, Milky Way")
saveContactInformation("123-456-7890")
saveContactInformation("[email protected]")
saveContactInformation("2 Franklin St, Mars, Milky Way")
```
{% endtab %}

{% tab 'Scala 3' for=regex-patterns_saveContactInfomation %}
{% tab 'Scala 3' for=regex-patterns_saveContactInformation %}
```scala
def saveContactInfomation(contact: String): Unit =
def saveContactInformation(contact: String): Unit =
import scala.util.matching.Regex

val emailPattern: Regex = """^(\w+)@(\w+(.\w+)+)$""".r
Expand All @@ -149,9 +149,9 @@ def saveContactInfomation(contact: String): Unit =
case _ =>
println("Invalid contact information, neither an email address nor phone number.")

saveContactInfomation("123-456-7890")
saveContactInfomation("[email protected]")
saveContactInfomation("2 Franklin St, Mars, Milky Way")
saveContactInformation("123-456-7890")
saveContactInformation("[email protected]")
saveContactInformation("2 Franklin St, Mars, Milky Way")
```
{% endtab %}

Expand Down