[Pharo-users] Regex usage question

Dimitris Chloupis kilon.alios at gmail.com
Tue Jan 26 13:21:25 EST 2016


Nope you should not apologize , you are not expected to read class comments
before asking questions here.

You will find a dedicate chapter on regex on Deep Into Pharo which you can
download as free PDFs from the Pharo website.

Pharo regex is very similar to other languages , AFAIK it's nothing
special. I used it for language parsing from Pharo to Python syntax. But if
you really want to do some complex parsing I highly recommend powerful
parser like SmaCC and PettitParser , the good news is that they use syntax
very similar to regex but far more readable, flexible and powerful. I used
SmaCC which comes with good documentation and ton of examples , I think
PettitParser is similar story.
On Tue, 26 Jan 2016 at 19:53, Cameron Sanders via Pharo-users <
pharo-users at lists.pharo.org> wrote:

> Ah! I found the RxParser class methods for syntax and usage. I missed
> these previously -- my apologies.
>
> On Tue, Jan 26, 2016 at 12:40 PM, Cameron Sanders <camsanders at aol.com>
> wrote:
>
>> Hi All. Nice work on Pharo!
>>
>> We are starting to use the Regex pattern matching by allowing users to
>> write "rules" using patterns. For example, our data lookup processing can
>> include a 'Per' rule that takes a key such as 'xPerY' and returns the value
>> of (data at: #x) / (data at: #y). Until recently, all binary-operators such
>> as Per were performed with a simple string matches. But in order to
>> generalize, we are moving regex patterns.
>>
>> Can someone tell me where the language-spec is for Regex-Core that is
>> included in Pharo? Is this in the style of sed, awk, or ... ? If possible,
>> how do I indicated that I want several sub-string replacement sections?
>>
>> Thanks in advance.
>> -Cam
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160126/c689ba07/attachment.html>


More information about the Pharo-users mailing list