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

PragmaticBookshelf
Dig under the surface and explore Ruby’s most advanced feature: a collection of techniques and tricks known as metaprogramming. Pa...
New
PragmaticBookshelf
TDD is a modern programming practice that all C developers need to know. It’s a different way to program—unit tests are written in a tigh...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
PragmaticBookshelf
Get ready for 30 teasers that will hone your Python skills and challenge your brain.. Miki Tebeka @tebeka edited by Margaret Eldridg...
New
New
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
First poster: bot
Node.js v14.19.0 has been released. Link: Release 2022-02-01, Version 14.19.0 'Fermium' (LTS), @richardlau · nodejs/node · GitHub
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
ManningBooks
Spring Security in Action, Second Edition is a revised version of the bestselling original, fully updated for Spring Boot 3 and Oauth2/Op...
New

Other popular topics Top

axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
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
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
AstonJ
Chris Seaton, the creator of TruffleRuby has died. It appears from suicide :cry: He left this note on Twitter on the weekend: And one...
New