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

0 like 0 dislike
42 views
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.
by

Related questions

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