[Cialug] Regex Question

Dan Ramaley dan at ramaley.net
Tue Jul 26 02:25:46 UTC 2022


Like others said, regex isn't particularly well suited for this. But 
this pattern will do what you want:

^((?!commandline).)*$

The thing to Google is "lookaround assertions".


On 2022-07-25 09:14, Todd Walton 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


More information about the Cialug mailing list