1

I would like to include the minus sign as part of my capture. As you can see below I tried to escape the minus sign. But as you run the query, it is obvious the minus sign is not included, not colored.

TEST="arquillian-bom"
echo $TEST|grep --color -E "[0-9|a-z|\-|\.|\_]+"
arquillian-bom

Also to verify that it is not included:

echo $TEST|grep --color -o -E "[0-9|a-z|\-|\.|\_]+"
arquillian
bom

I'm using the bash on Mac OSX

grep -V
grep (BSD grep) 2.5.1-FreeBSD

Any idea how to include the minus sign, or to escape this minus sign properly? I tried \- or \\- or \\\- they all failed.

RonPringadi
  • 1,294
  • 1
  • 19
  • 44

0 Answers0