How to check the coincidence at the end of the line?

0 like 0 dislike
Tell me how to check whether the entry in the last row and does not have any after the characters?

For example I'm looking for the word car in a sentence This is a car and it should return true, but This is a car or something else it should return false because then there is the text.
by | 42 views

1 Answer

0 like 0 dislike
Elementary a: /(car)$/ -when after nothing no symbols, spaces, line break.
With a line break, but without tabs, spaces: /(car)(?=$|\)/
MB I something not so understood the task.

Related questions

110,608 questions
257,186 answers
33,909 users