Problem with std.regex: *+? not allowed in atom

Dmitry Olshansky dmitry.olsh at gmail.com
Tue Mar 1 07:54:05 PST 2011


On 27.02.2011 13:41, Jacob Carlborg wrote:
> On 2011-02-26 19:49, Dmitry Olshansky wrote:
>> On 26.02.2011 19:52, Jacob Carlborg wrote:
>>> On 2011-02-26 12:29, Dmitry Olshansky wrote:
>>>> On 26.02.2011 14:10, Jacob Carlborg wrote:
>>>>> I'm trying to use the std.regex module but when I run my 
>>>>> application I
>>>>> get an exception. The exception message says:
>>>>>
>>>>> *+? not allowed in atom
>>>>>
>>>>> The code I have is:
>>>>>
>>>>> import std.regex;
>>>>>
>>>>> void main ()
>>>>> {
>>>>> regex(`\.(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))`, "m");
>>>>> }
>>>>
>>>> Well the thing is, std.regex is not quite ECMA complaint (as vaguely
>>>> stated in docs). To the best of my knowledge not a single one 
>>>> variant of
>>>> the forms (?:...) ... (?=...) is supported . Also see
>>>> http://d.puremagic.com/issues/show_bug.cgi?id=5169, you may try out my
>>>> patch there to support (?:...). It's a slightly outdated, but 
>>>> std.regex
>>>> wasn't in very active development.
>>>
>>> I tried the patch but with no success. I still get the same error.
>>>
>> The patch fixes only (?: ) form and not the lookahead and others. Sorry,
>> it was the only one I needed back then.
>> I'll check if I can make a patch for them as well when I have some spare
>> time. That's would be around monday if, of course, nobody else wishes to
>> rush into the depths of std.regex.
>
> Ok.
>
So here it is, hot and bobbling. For now no lookbehind.
I added it into another Bugzilla 
requesthttp://d.puremagic.com/issues/show_bug.cgi?id=5673

-- 
Dmitry Olshansky



More information about the Digitalmars-d-learn mailing list