Assuming I've understood your need correctly, if your match command takes the form pcregrep -o1 '(match)', the corresponding regex that would report a match only if another string is not matched is pcregrep -o1 '^(?!.*donotmatch).*(match)'. Look up negative lookahead expressions in the PCRE documentation. Also notice the .* in front of the (groupmatch); this is needed due the anchoring of the negative looking ahead expression to the start of the line via the ^
Assuming I've understood your need correctly, if your match command takes the form pcregrep -o1 '(match)', the corresponding regex that would report a match only if another string is not matched is pcregrep -o1 '^(?!.*donotmatch).*(match)'. Look up negative lookahead expressions in the PCRE documentation. Also notice the .* in front of the (group); this is needed due the anchoring of the negative looking ahead expression to the start of the line via the ^
Assuming I've understood your need correctly, if your match command takes the form pcregrep -o1 '(match)', the corresponding regex that would report a match only if another string is not matched is pcregrep -o1 '^(?!.*donotmatch).*(match)'. Look up negative lookahead expressions in the PCRE documentation. Also notice the .* in front of the (match); this is needed due the anchoring of the negative looking ahead expression to the start of the line via the ^
Assuming I've understood your need correctly, if your match command takes the form pcregrep -o1 '(match)', the corresponding regex that would report a match only if another string is not matched is pcregrep -o1 '^(?!donotmatch.*donotmatch).*(match)'. Look up negative lookahead expressions in the PCRE documentation. Also notice the .* in front of the (group); this is needed due the anchoring of the negative looking ahead expression to the start of the line via the ^
Assuming I've understood your need correctly, if your match command takes the form pcregrep -o1 '(match)', the corresponding regex that would report a match only if another string is not matched is pcregrep -o1 '^(?!donotmatch).*(match)'. Look up negative lookahead expressions in the PCRE documentation. Also notice the .* in front of the (group); this is needed due the anchoring of the negative looking ahead expression to the start of the line via the ^
Assuming I've understood your need correctly, if your match command takes the form pcregrep -o1 '(match)', the corresponding regex that would report a match only if another string is not matched is pcregrep -o1 '^(?!.*donotmatch).*(match)'. Look up negative lookahead expressions in the PCRE documentation. Also notice the .* in front of the (group); this is needed due the anchoring of the negative looking ahead expression to the start of the line via the ^
Assuming I've understood your need correctly, if your match command takes the form pcregrep -o1 '(match)', the corresponding regex that would report a match only if another string is not matched is pcregrep -o1 '^(?!donotmatch).*(match)'. Look up negative lookahead expressions in the PCRE documentation. Also notice the .* in front of the (group); this is needed due the anchoring of the negative looking ahead expression to the start of the line via the ^