Regular Expressions 101

Community Patterns

toki pona tokenization

0

Regular Expression
PCRE2 (PHP >=7.3)

/
\b(?:[ptkmnlswj]? (?:(?<=w)[aei]| (?<=[jt])[aeou]| (?<=[pkmnls])[aeiou]| (?<=\b)[aeiou]) (?:n(?![nm]?[aeiou]))?)+\b
/
ixg

Description

a regex for matching words according to the rules of writing toki pona in latin characters

Submitted by anonymous - 2 years ago (Last modified 2 years ago)