|
I tried using a regular expression with a colon in it earlier. Basically, this is what I wanted to achieve in Finder but in a playground instead:
'do:' matchesRegex: '^do:$'.
The result was the terse and cryptic:
RegexSyntaxError: no terminating ":"
By looking through the source code and doing some Googling I was eventually able to find documentation from an old Squeak release on this subject:
http://www.mirandabanda.org/files/Cog/VM/SpurImages/2016-02-15/trunk50-64-15623.changes
(Look for "message predicate".)
What this is is in fact a fairly clever feature that allows unary messages to be sent to a character or characters (depending on what follows) but it is nonstandard and totally undocumented as is. So, for example, the following will evaluate to true:
'42' matchesRegex: ':isDigit:+'.
Brief official documentation of this unusual feature that could help some or at least not baffle others would be most welcome.
|
|
|
Priority: 4 – Would be nice
|
|
Status: Work Needed
|
|
Assigned to: Everyone
|
|
Milestone: Later
|
Go to Case
|
|