Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Haskell Data Analysis

You're reading from   Getting Started with Haskell Data Analysis Put your data analysis techniques to work and generate publication-ready visualizations

Arrow left icon
Product type Paperback
Published in Oct 2018
Publisher Packt
ISBN-13 9781789802863
Length 160 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
James Church James Church
Author Profile Icon James Church
James Church
Arrow right icon
View More author details
Toc

Dots and pipes

In this section, we're going to cover two basic bits of regular expression syntax, and those are dots and pipes. So, to begin, we are going to install the regular expression library in Haskell, and we are going to introduce the dot and the pipe syntax. Let's find the Terminal, and we need to begin by installing the library, which can be done with the following command:

So, cabal install regex-posix will install our regular expression library. Now, once installed, let's go and create a new notebook, and dive in. We are going to name this notebook as RegexLearning. We need to import the Text.Regex.Posix library, so that we can access the =~ operator, which is necessary to look at regular expressions. Let's define a couple of strings in order to get us started:

As you can see, str1 is "one fish two fish red fish blue fish", the title...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime