fork download
  1. #!/bin/bash
  2. s="####should be matched#### ignore the red text#########3
  3. suvoo:
  4. :suvoo:
  5. suvoo
  6. suvoo:
  7. suvoo'
  8. suvoo\`
  9. \`suvoo\`
  10. "'"'"suvoo"'"'"
  11. 'suvoo:
  12. 'suvoo "'"'"ghj
  13. 'suvoo
  14. [suvoo~
  15. {suvoo'
  16. his name was \`suvoo'
  17. his name is suvoo and he is 25
  18. ####shouldnt be matched####
  19. asddsuvooaed
  20. :suvo@abc:
  21. suvooo
  22. 1suvoo
  23. suvoo1:"
  24.  
  25. grep -E '(^|[[:space:]"'"'"'`(,:;<[{|~])suvoo([][:space:]"'"'"'),:;>`}|~]|$)' <<< "$s"
Success #stdin #stdout 0s 19632KB
stdin
Standard input is empty
stdout
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