I am struggling with a particular regex i need to pass into the grep -E
in plain english, the regex must match the word if it matches both of these two conditions:
the word begins at the start of the line OR begins with a space character or any of the following "'`(,:;<[{|~
the word ends in "'),:;>]`}|~ or a space character, OR is at the end of the line.
####should be matched#### ignore the red text#########3
suvoo:
:suvoo:
suvoo
suvoo:
suvoo'
suvoo`
`suvoo`
"suvoo"
'suvoo:
'suvoo "ghj
'suvoo
[suvoo~
{suvoo'
his name was `suvoo'
his name is suvoo and he is 25
####shouldnt be matched####
asddsuvooaed
:suvo@abc:
suvooo
1suvoo
suvoo1:
I'm not sure about why my command does not matched anything, i might have completely misunderstood what needs escaping etc
grep -Einr "(^|[[:space:][\"'(,:;<[\`{|~]])suvoo([[:space:][]\"'),:;>\`}|~]]|$)" .