DMD 0.148 - regular expressions

Tom Tom_member at pathlink.com
Sun Feb 26 16:10:19 PST 2006


In article <op.s5lmdqep6b8z09 at ginger.vic.bigpond.net.au>, Derek Parnell says...
>
>On Mon, 27 Feb 2006 06:46:41 +1100, Tom <Tom_member at pathlink.com> wrote:
>
>> In article <op.s5lhaxyb6b8z09 at ginger.vic.bigpond.net.au>, Derek Parnell  
>> says...
>>>
>>> On Mon, 27 Feb 2006 04:58:21 +1100, Walter Bright
>>> <newshound at digitalmars.com> wrote:
>>>
>>>>
>>>> "Lars Ivar Igesund" <larsivar at igesund.net> wrote in message
>>>> news:dts47r$14c0$1 at digitaldaemon.com...
>>>>> I liked the idea (match expressions), just not the operator, and I
>>>>> thought
>>>>> that was a common opinion...
>>>>
>>>> if ("regex" ~~ "string")
>>>>     _match. ...
>>>>
>>>> The equivalent functionality can now be done with:
>>>>
>>>> if (m; search("string", "regex"))
>>>>     m. ...
>>>
>>> I don't think that is quite correct. This program failed to compile ....
>>>
>>>   void main()
>>>   {
>>>     if (m; search("string", "regex")) {}
>>>   }
>>>
>>>
>>> I got the messages ...
>>>   test2.d(3): undefined identifier search
>>>   test2.d(3): function expected before (), not search of type int
>>>
>>> It turns out that "import std.regexp;" is now required.
>>
>> This was pretty obvious IMO, don't you think so? :) I mean, if the  
>> feature was
>> removed, of course, you would require 'std.regexp' imported again. I  
>> think
>> Walter omitted it because of that.
>
>Of course it was obvious; that was my point.
>
>Walter had written that
>   "if ("regex" ~~ "string")"
>was functionally equivalent to
>   "if (m; search("string", "regex"))"
>and while that is true, it gives the impression that this was the *only*  
>change to the new D. I just wanted to point out that the implicit  
>importing of std.regexp was also removed.

Ok, I forgive you :) :P
Now seriously, I see your point.

Regards,

Tom;



More information about the Digitalmars-d mailing list