Library of the day: Gaea re library

Gaea re library for regular expression operations is out.

A regular expression can be comprised of a specific sequence of characters,  a "patern" of characters. In this way it can facilitate the matching of complex sequences of strings, using specialized syntax contained in pattern(s).

The following example contains one form of usage of the  re library:

GAEA > (require :re)
NIL
GAEA > (re:scan "b(.)r" "foo bar baz bur") 
4
7
#(5)
#(6)

The first and second return values are the start and end of the matching substring "b(.)r", respectively. Note that only the first instance "bar" is found. To find the next instance, we should pass the value for the keyword parameter :start.

GAEA > (re:scan "b.r" "foo bar baz bur" :start 5)
12
15
#13()
#(14)

The full reference for re library can be found here.

If you want to know more, feel free to always contact us.