[squeak-dev] Regex: compatibility and colons

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Fri Oct 22 09:16:21 UTC 2021


Hi all,


Tom has asked me whether the following string could be treated as a valid regular expression in Squeak:


    (:)+


Currently, this raises a regex syntax error because we use colons to denote message predicates such as in ':isSafeForHTTP:+'. However, if the tokens after a colon do not constitute a valid selector symbol, we *could* also consume the token as a normal character.


Initially, I disagreed with this change because it would increase the grammatical complexity of Squeak regexes. Also, we do not consider '(+' or 'a{+' valid regexes. (However, many - but not all - other regex flavors accept 'a{+' indeed - maybe we should subject this behavior to change as well?) On the other hand, Tom would like to improve the compatibility with other regex flavors which usually do not assign a special meaning to the colon.


What do you think? I am looking forward to hearing your arguments!


Best,

Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211022/78ebba4d/attachment.html>


More information about the Squeak-dev mailing list