Re: [Boston.pm] more specific regex error messages?
Bill Ricker via Boston-pm <[email protected]> Fri, 25 Feb 2022 15:26:45 -0500
| Newsgroups | gmane.comp.lang.perl.perl-mongers.boston |
|---|---|
| Message-ID | <CAAbKA3XuedjYz0xd+=AkiSmiMV=vq=Bm5-o8exCPvja6CD+Spw@mail.gmail.com> |
On Fri, Feb 25, 2022, 13:19 <email-2Ro/Dj86MvDSUeElwK9/[email protected]> wrote: > Is there a way to get better built in reporting with regexps? > with the above, if the string doesn't match, I get "bad input". > > What I'd rather get is something like "expecting \:thing2" > That behavior is more associated with full on parser modules built with grammars . For bespoke Perl *sans* modules, you'll need to structure your match/diagnose code as a parser and not simple matxh-extract. Did MJD HOP book cover this? Or Manning Data Munging? >