Search code examples
regeximplementationstring-matchingsmalltalkpharo

What kind of regular expression matching is implemented in Pharo?


I came across this question in computer science stack exchange, Theory behind regex implementations, pointing to this paper, Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, ...), discussing the fact there is two big families of regular expression(-like) implementations, and their relative merits. One is implemented, for example, by Awk, Tcl, GNU grep, and GNU awk. The other, for example, by Perl, Python, Ruby, Java. So I ask, what implementation does Pharo use?


Solution

  • There are several ways to look at this.

    Out of the box, one can do

    enter image description here

    The help will give you more details:

    Pharo Regex Help

    That being said, if you want to parse complex stuff, you can look into PetitParser, SmaCC and other things of that kind which will also implement objects that can match against other things, like strings and more.

    And FuzzyMatcher may also be of interest:

    FuzzyMatcher