Re: how to find particular string from text column
"Mastering Regular Expressions" is a good book.
Here's a breakdown of '(^|[|])SEWER\s*:\s*Septic([|]|$)'
(|) -- either of the two things inside ('|' means 'OR').
^ -- start of string ("anchored" at beginning) -- I am assuming your text could be
"SEWER:Septic|GARAGES:2|MICROWAVE:Yes"
If, instead you are sure to have '|' at both ends, as
"|SEWER:Septic|GARAGES:2|MICROWAVE:Yes|"
then the regexp could be simplified to:
'[|]SEWER\s*:\s*Septic[|]'
$ -- anchor at end
[] -- any of the set of characters inside. In this case [|], I am avoiding the special meaning of '|' as 'OR'
SEWER and : and Septic -- exact matches on those strings
\s -- "white space", that is, space, tab, carriage return, etc.
* -- zero or more of what preceeds (contrast + meaning 1 or more, and ? meaning 0 or 1)
\s* -- zero or more spaces, tabs, etc. (probably zero in your case)
Possibly, this is all you need:
REGEXP '[|]SEWER:Septic[|]'
or
LIKE '%|SEWER:Septic|%'
The percents are there because LIKE is anchored by default, unlike REGEXP.
LIKE tends to be faster (in MySQL), but REGEXP is more powerful.
LIKE has only two special characters ( % _ ); REGEXP has lots.