rustkas

rustkas

Using Regular Expressions in Erlang

Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either casually mentioned or not touched upon. Regular expressions are a powerful helper in any programming language. I am wondering how it is implemented in Erlang.

When I started to implement my CSV converter solution, which you can read about in the “Property-Based Testing with PropEr, Erlang, and Elixir” book’s Journal for input text encoding, I decided to try using the functionality of the Erlang re library, but I realized that its capabilities are very powerful and I need to understand it in more detail (its skillful use will provide a convenient tool for implementing various ideas).

I start reading “Introducing Regular Expressions”. The book’s source code examples and Erlang re library documentation gave me enough information to start my research (rebar3 based Erlang project implementation) into this area.

If anyone has anything to share on this topic, please do share! :bulb: :blush:

Most Liked

Rainer

Rainer

Regex is such a nice tool, but unfortunately I’m using it rarely, so every time I use it it feels a bit awkward at the beginning.
I also use the already mentioned RegExr to write the expression first.

It’s always good to know about regex when solving some coding puzzles like Advent of Code. I used it there with Erlang :slight_smile:

OvermindDL1

OvermindDL1

Joooin uuuusss…

Lol, not kidding though, I use regex at least once a day, and occasionally 150 times in a day. ^.^;

Not even with just programming stuff, but in just text editing most often.

NobbZ

NobbZ

They are indeed the same string, and therefore will result in the same regex.

As there is no first level syntax support for regexes in Erlang you have two escape the backslash in the string such that the regex engine actually sees it.

Popular Backend topics Top

New
bot
A new item has been posted: This thread was posted automatically, if you feel it could be in a better category and are at Trust Level ...
New
New
New
New
AstonJ
Inspired by this post by @stefan.jarina, I’m curious about the kind of Bash scripts you’ve written and whether you still use Bash given t...
New
Jsdr3398
I love how elixir works and some of its perks, but I’m still pretty uncomfortable, especially when mix/hex gets involved. Did anyone els...
New
Jsdr3398
I really need developers to help create my messaging platform but I’m not sure how much they want etc. I’ve never hired anyone before :s...
New
mafinar
We always have fun in this forum around this time of the year, discussing the days’ (or yesterdays’) challenges and talking through solut...
New
jaeyson
Hey! Just a random thought though: Found an article from fudzilla where AI can be a good debugger. How does one integrate something like ...
New

Other popular topics Top

AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New