Concept:RegularExpression

Most Scheme implementations come with some sort of regular expression matcher, but the interface varies a lot.

  • The language it accepts: POSIX, GNU regex library, Perl-compatible library, SRE, or original.
  • Whether it has disjoint regexp object, or just uses string to represent regexp.
  • The return type of match. substring? indexes? or a special match object?
  • If it has regexp object, whether it supports literal representation of regexp or not.
  • Procedure names to match.

Chicken

Scheme48

Gauche

MzScheme

  • language: egrep, Perl-compatible
  • regexp object: Yes
  • return type of match: substring, indexes.
  • literal representation: #rx"regexp" (regexp), #rx#"regexp" (byte-regexp), #px"regexp" (pregexp), #px#"regexp" (byte-pregexp)
  • API: regexp?, pregexp?, regexp?, pregexp??, byte-regexp?, byte-pregexp?, byte-regexp??, byte-pregexp??, regexp-match, regexp-match-positions, regexp-match??, regexp-match-peek?, regexp-match-peek-positions?, regexp-match-peek-immediate?, regexp-match-peek-positions-immediate?, regexp-replace, regexp-replace*?

STklos

LIPS

  • langauge: JavaScript (except no spaces inside)
  • regexp object: Yes
  • literal expressions: /foo|bar/
  • API: match, search, split functions or invoking methods on strings with --> macro like in Javascript