Text compare with a regular expression

Is there any way to compare Text with a regular expression in Motoko?

I don’t think so, but you could write a parser using the parsec package to achieve the same thing.

Thanks for the clarification @paulyoung. Where can I get information about parsec ?


It’s in the vessel package set:



Thanks @paulyoung . I will take a look.

https://github.com/kritzcreek/motoko-regex might also be of interest, though I think it was merely meant to illustrate a simple library, not a full fledged regex implementation.

1 Like