[DGD] parse_string regular_expression

Shentino shentino at gmail.com
Mon Apr 12 21:42:57 CEST 2010


Indeed.

One escaping to turn it into a regex, and another escaping to make it a
quoted string I presume?

On Mon, Apr 12, 2010 at 11:55 AM, <bart at wotf.org> wrote:

> Keep in mind that when defining tokens for parse_string, / denotes the
> beginning and end of a regular expression.
>
> So, a token that matches C style comments /* comment */ would be defined
> by:
>
> comment = /\\/\\*([^*]|\\*+[^/*])*\\*\\//
>
> taken from Dworkin's LPC grammar for parse_string as used by
> http://mud.wotf.org/downloads/lpc/happycode.c
>
> Bart.
>
> On Mon, 12 Apr 2010 00:50:48 -0700, Shentino wrote
>  > Regarding malformedness...
> >
> > //[^*\n]+/
> >
> > Appears to be interpreted an empty regex "//" followed by
> > gibberish...apparently one too many slashes at the beginning
> >
> > /\\/\*(.*?)\*\//
> >
> > /, escaped \, /, then more stuff outside the regex.
> >
> > My guess is that you fell victim to a couple of typos.
> > ___________________________________________
> > https://mail.dworkin.nl/mailman/listinfo/dgd
>
>
> --
> Created with Open WebMail at http://www.bartsplace.net/
> Read my weblog at http://soapbox.bartsplace.net/
>
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
>



More information about the DGD mailing list