(Solved) RegEx Problem

Get help with using AutoHotkey and its commands and hotkeys
ahcahc
Posts: 110
Joined: 25 Jul 2014, 23:55

(Solved) RegEx Problem

06 Aug 2014, 11:36

Hi, I have a text below that need I need to match a sentence that contains that word "car".
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..
Last edited by ahcahc on 06 Aug 2014, 15:36, edited 1 time in total.
User avatar
nnnik
Posts: 4461
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: RegEx Problem

06 Aug 2014, 12:15

This

Code: Select all

Regexmatch(Sentences,"\.([^\.]*?car[^\.]*\.)",out)
is the one I'd use.
I also use http://regex101.com/#pcre :P
Recommends AHK Studio
ahcahc
Posts: 110
Joined: 25 Jul 2014, 23:55

Re: RegEx Problem

06 Aug 2014, 15:35

Thank you....

Return to “Ask For Help”

Who is online

Users browsing this forum: barbaque, Google [Bot] and 257 guests