Home All Groups Group Topic Archive Search About
Author
11 Mar 2006 11:34 PM
siddharthkhare
Hi All,
I want to capture a pattrens..using regular expresion in c#
let say in following sentence

This is a boy.

I want to capture "boy" only if it is with in 10 character form index
where "is" started.

so lets say "is" started at index 7 ,I want to capture boy only if
starts at index 17 or less.

So two  conditions "boy" has to be prefixed with "is" somewhere in the
sentence and must be with in 10 charaters apart from "is" .

Is it possible to do this in one regural expression?
Thanks
KS

Author
12 Mar 2006 1:46 AM
Jon Shemitz
siddharthkh***@hotmail.com wrote:

> This is a boy.
>
> I want to capture "boy" only if it is with in 10 character form index
> where "is" started.

  is.{1,8}(boy)

You may want to use the RegexOptions.Singleline option.

--

<http://www.midnightbeach.com>     Contracting, consulting, training
..NET 2.0 for Delphi Programmers  <http://www.midnightbeach.com/.net>
                                   In production - in stores by June

Bookmark and Share