Skip to content

gleam-lang/regexp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Regexp

Regular expressions in Gleam!

Package Version Hex Docs

gleam add gleam_regexp@1
import gleam/regexp

pub fn main() {
  let assert Ok(re) = regexp.from_string("[0-9]")

  regexp.check(re, "abc123")
  // -> True

  regexp.check(re, "abcxyz")
  // -> False
}

This package uses the regular expression engine of the underlying platform. Regular expressions in Erlang and JavaScript largely share the same syntax, but there are some differences and have different performance characteristics. Be sure to thoroughly test your code on all platforms that you support when using this library.

Further documentation can be found at https://hexdocs.pm/gleam_regexp.