This is the pattern I use (\.).*(car)(.*?\.). I use period (.) as the beginning and end of the sentence. But it matches more than just the sentence. It matches from the first period of the line, I need to match the closest period from "car". I use this site to practice http://www.regexr.com/.
Code: Select all
. . . . . . . . ABC That. This <span> abc car. This cat. That tree. This new car pool. This dog. This plant.<b> This (something in between the) car. Cats.<b> This old car can fly. Something. Sometext text text . The car is red..