ID:134125
 
Is there any chance regex will ever be included in DM?
In response to Elation
Unless you're cheap and don't want to shell out $5 for Lummox's Regex library. =)

That's unless hub://Theodis.RegEx is complete enough for your purposes; I haven't used it, so I don't know how much it does. It does say it's a "simple" one, and regex parsers tend to be pretty complex...
In response to Crispy
Crispy wrote:
and regex parsers tend to be pretty complex...

They scare me. :(
In response to Crispy
Crispy wrote:
Unless you're cheap and don't want to shell out $5 for Lummox's Regex library. =)

That and the fact that a built-in regex parser will be much faster than any soft-coded one.
In response to Crispy
It does say it's a "simple" one, and regex parsers tend to be pretty complex...

I haven't actually looked that closely at Theodis's parser, but it's actually not terribly difficult to write a parser that converts regexes into finite state machines, and it's trivial to run strings through those machines to find matches. I've done this in two separate languages, but unfortunately not in DM (yet). I'm guessing this is the method Theodis used.
Backtracking parsers (ala Perl) are slightly more difficult to write, but don't look too incredibly hard. In theory, that is--as I haven't tried to write one, but I have read about the procedure.

I do still think it would be beneficial for BYOND to have built-in regex handling (via a C library), but really, only a handful of us would ever use it. I'd rather see more cool glitzy 4.0 front-end features than neat back-end additions like this.
In response to Popisfizzy
Popisfizzy wrote:
That and the fact that a built-in regex parser will be much faster than any soft-coded one.

while true, i doubt you'd need the speed unless you were trying to parse something large, like the Magna Carta. for the majority of BYOND game needs, Lummox's or Theodis' should be more than fast enough.
In response to digitalmouse
Well, there's also the fact that it could do some more complex things. If I remember correctly, Lummox's can't do lookahead and lookbehind.