I believe the answer is no, you cannot include ^ and $ as anchors in [] , only as literals. (I also wanted you to do this).
However, you can concatenate the space at the front and back of the line, and then just look for \s as word boundaries and ignore the anchors. For instance.
analyze-string(concat(' ', 'abcd xyz abcd', ' '), '\sabcd\s')
You may also want + after each \s , but this is a separate issue.
Larsh source share