Say I have a long string of text, and I want to capture every time the word this is mentioned within rounded brackets. How could I do that? The following patt
this
I implemented the regex to enclose all alphanumberic characters using regex below:
# cat testfile aabc a1 +++ xyz 20 30 =40 -r # cat testfile | sed -e "s/\([[:alnum:]]\{1,\}\)/\1/g" aabc a1 +++ xyz 20 30 =40 -r #
\1/g" aabc a1 +++ xyz 20 30 =40 -r #
aabc a1 +++ xyz 20 30 =40 -r #
a1 +++ xyz 20 30 =40 -r #
xyz 20 30 =40 -r #
20 30 =40 -r #
30 =40 -r #
40 -r #
r #
Hope it helps.