Bethlee
Bethlee

Reputation: 955

How can I find not same data using mysql regexp in multiline text?

I tried to find the data using regexp in multiline text. My regexp is 'Audit Policy,[A-Za-z0-9|[:space:]]+,Success and Failure'.

# query
SELECT *
  FROM docs
 WHERE content not regexp 'Audit Policy,[A-Za-z0-9|[:space:]]+,Success and Failure';

# data
'Audit Policy,Audit account logon events,No Auditing
Audit Policy,Audit account management,Success and Failure
Audit Policy,Audit logon events,No Auditing
Audit Policy,Audit object access,Success and Failure'

I think I can search the whole data included in 'Audit Policy,Audit logon events,No Auditing' when I run the below code but it's not that work. Is there a way to get that line only using SQL queries?

SQL Fiddle: http://sqlfiddle.com/#!9/8adc4b/2

My sql version is 5.7.25 / the data column type is varchar.

Upvotes: 0

Views: 55

Answers (0)

Related Questions