Julia regular expressions
Julia has built-in regular expression handling-as do most modern programming languages. There is no need for a using
statement, as regular expressions are basic features of strings in Julia.
We could have a small script that verifies whether a string matches a phone number, for example:
ismatch(r"^\([0-9]{3}\)[0-9]{3}-[0-9]{4}$", "(781)244-1212") ismatch(r"^\([0-9]{3}\)[0-9]{3}-[0-9]{4}$", "-781-244-1212")
When run in Jupyter, we see the following results, that is the first number is conformant to the format and the second is not:
