I'm doing some regexp in shell to find coding style error in *.c files. Actually I'm doing something like this:
# Operator <
if [[ "$1" =~ ([^ ]<|<[^ =$]) ]]; then
warn "$wmsg_space_operator (operator: <)"
fi
But I want to do it like this:
# Operator <
regexpOp=([^ ]<|<[^ =$])
if [[ "$1" =~ $regexpOp ]]; then
warn "$wmsg_space_operator (operator: <)"
fi
How can I do?