I’m trying to create a regex to match anything else but ACTIONLOGDIR=”/vz/actionlog”. So far, I came up with this:
^(?:(?!ACTIONLOGDIR="/vz/actionlog)).*$
Unfortunately, it’s also not matching some things that it should. For example:
ACTIONLOGDIR="/vz/actionlog" - not matching, this is OK
ACTIONLOGDIR="/vz/blabla" - matching, is OK
ActionLogDir="/vz/actionlog" - matching, is OK
ACTIONLOGDIR="/vz/actionLOG" - matching, is OK
ActionLogDir="/vz/actionLOG" - matching, is OK
VIRTUOZZO="/var/actionlog" - matching, is OK
ACTIONLOGDIR="/vz/actionlog"""""" - this is not matching, it should
ACTIONLOGDIR="/vz/actionlog"ACTIONLOGDIR="/vz/actionlog" - this is not matching either
I also tried to use:
^(?:(?!ACTIONLOGDIR="/vz/actionlog))["]{1}$
and several other variations… But with this is not matching anything.
To be more specific, I’m looking for the variable name, if that one matches in the first place, it should look for the value after the equal sign and see if it’s the right one.
Any help is greatly appreciated.
Well, not sure whether I understood clearly what you want to match, but you can try this regex, which will work for the strings that you have posted: –