Vassili's Regex

Brian Murphy-Dye brian.murphydye at mac.com
Wed Oct 20 14:43:14 UTC 2004


On Oct 20, 2004, at 8:31 AM, Torsten Bergmann wrote:

> Hi,
>
> Thanks for the quick response. The description in RxParser(class)
>>> #c:syntax: for ^ was a little bit misleading here. Now I
> understand.
>
>> If you need to match the spaces (and tabs/newlines), try
>> ' 1'  matchesRegex: '[[:space:]]*[0-9]'
>
> The ST extension for unary messages is nice. Could this also be
> achieved without the syntax extension (for example in other
> languages RegEx packages)?

Both of these also work:

' 1' matchesRegex: ' *[0-9]'
' 1' matchesRegex: '[\s]*[0-9]'

> I've seen that other packages (PHP) also support a {} notation
> for instance to check money amounts they use:
>
>   ^([0-9]){1,3}(.[0-9]{3})*(,[0-9]{2})?$

Yes, I too miss this notation. But overall the Regex package is 
sufficient and works well.

>
> Thx
> Torsten
>
>
>
> -- 
> GMX ProMail mit bestem Virenschutz http://www.gmx.net/de/go/mail
> +++ Empfehlung der Redaktion +++ Internet Professionell 10/04 +++
>
>




More information about the Squeak-dev mailing list