Page 1 of 1

Matching sentence between two strings

Posted: Thu Aug 28, 2008 5:00 am
by lightInt
Hi,

I am trying to create a regex that will match a sentence between two specific strings.
below is the sentence to match, the part I would like to match is marked in bold.

[[Text:hi this is a nice sentence[[very nice]] I like this text]] this is not related [[not]]

I have the following regex: \[\[Text:.*?]]
The problem is that it stops at the ]] after "very nice" and matches only: [[Text:hi this is a nice sentence[[very nice]]

Thanks anyone for any help.

Light Interactive.

Re: Matching sentence between two strings

Posted: Thu Aug 28, 2008 9:27 am
by prometheuzz
When after some time you're not being answered in one place, I can imagine posting somewhere else. You however, cross posted this almost at the same time in at least one other forum, which is rather rude: people here could be wasting their time by answering you because you are already answered somewhere else:

http://regexadvice.com/forums/thread/45732.aspx

Re: Matching sentence between two strings

Posted: Thu Aug 28, 2008 10:29 am
by lightInt
Problem solved. Thanks.

Re: Matching sentence between two strings

Posted: Thu Aug 28, 2008 10:38 am
by prometheuzz
lightInt wrote:Problem solved. Thanks.
Yes, I saw that. Next time, please provide a link to the other forum(s) you posted your question: people can then first check to see if you've been answered elsewhere before spending time on your question.