I was wondering if my expression here can match the word cat or Cat only at the beginning of a line and if this also means that if there is a new line, it will also match, it is not just at the beginning of the entire chunk of text/string.
ex:
cat and
Cat
would highlight both instances at the beginning of the two lines
/^\b([Cc]at)\b/g
My other, separate, question is, how do you match, let's say, 'cat', anywhere except for at the beginning of a line? How do you negate the beginning of line, but include all other instances?
ex:
cat likes cat and himself.
would only match the second mentioning of the word cat.