
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!
Most Liked

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

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
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










Other popular topics









Latest in Backend
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /sublime-text
- /textmate
- /react-native
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /c
- /julia
- /neovim