From man expr :
expr1 : expr2 The ``:'' operator matches expr1 against expr2, which must be a regular expression. The regular expression is anchored to the beginning of the string with an implicit ``^''. expr expects "basic" regular expressions, see re_format(7) for more informa- tion on regular expressions.
@ is just @ because it does not really matter in the regular expression. In this way,
expr _@foo @ : " _@ [^@]*@"
will succeed and print 6 (this is the number of matching characters); while
expr _x@foo @ : " _@ [^@]*@"
will output 0 and return an error code in $? because he cannot match anything.
If you are not familiar with regular expressions, then one of the examples in your example means: an underscore ( _ ) follows two at ( @ ) characters that let in any number of unsigned characters.
source share