[Cialug] Regex Question

Scott Yates Scott at yatesframe.com
Mon Jul 25 15:39:40 UTC 2022


Yes, regex is probably not the right tool for that.  jq would be better, or
even just a little script, but trying to parse json with regex is asking
for serious headaches.

On Mon, Jul 25, 2022 at 10:18 AM Will <staticphantom at gmail.com> wrote:

> I wouldn't use regex for this but I would use jq and pluck the fields you
> want. Alternatively use grep -v and omit the line command line.
>
> -Will C
>
> On Mon, Jul 25, 2022, 11:15 Todd Walton <tdwalton at gmail.com> wrote:
>
> > Let's say I have a block of text like this:
> >
> > ===================================
> >             {
> >                 "altGrAliasing": true,
> >                 "antialiasingMode": "grayscale",
> >                 "closeOnExit": "graceful",
> >                 "colorScheme": "Campbell",
> >                 "commandline":
> >
> >
> "C:\\Users\\seven\\AppData\\Roaming\\Scoop\\apps\\msys2\\current\\msys2_shell.cmd
> > -defterm -here -no-start -msys",
> >                 "cursorShape": "bar",
> >             },
> > ===================================
> >
> > How do I write a regex to match all lines *except* the "commandline"
> line?
> >
> > --
> > Todd
> > _______________________________________________
> > Cialug mailing list
> > Cialug at cialug.org
> > https://www.cialug.org/cgi-bin/mailman/listinfo/cialug
> >
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> https://www.cialug.org/cgi-bin/mailman/listinfo/cialug
>


More information about the Cialug mailing list