I came here across the command grep -E '(^| )ABC( |$)' file1 I am confused how to interpret the regular expression therein, because I know the ^ and $ character as beginning and end signifier, but in here they are not at the very beginning or end because of the bracket, ^ is sometimes used to negate a set of character, but I have seen this usage only in [^....] like expression.
Could someone explain step by step the meaning of this regex ?