November 2016
Intermediate to advanced
697 pages
14h 44m
English
To search for and match patterns in text and other data, regular expressions are an indispensable tool for the data scientist. Julia adheres to the Perl syntax of regular expressions. For a complete reference, refer to http://www.regular-expressions.info/reference.html. Regular expressions are represented in Julia as a double (or triple) quoted string preceded by r, such as r"..." (optionally, followed by one or more of the i, s, m, or x flags), and they are of type Regex. The chapter 2\regexp.jl script shows some examples.
In the first example, we will match the e-mail addresses (#> shows the result):
email_pattern = r".+@.+"
input = "john.doe@mit.edu"
println(ismatch(email_pattern, input)) #> true
The regular expression pattern ...
Read now
Unlock full access