|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Regex questionHi 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 siddharthkh***@hotmail.com wrote:
> This is a boy. is.{1,8}(boy)> > I want to capture "boy" only if it is with in 10 character form index > where "is" started. 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
Other interesting topics
Passing in different int context on same signature?
Generic Dictionary performance? Identify Interface in ArrayList of Intfaces Returning application name from hWnd handle. Returning application name from hWnd handle Specifying an interface-implemenation as parameter ComboBox like Address bar in IE or in Run Dialog box Best value Help file builder Many Classes Vs Many Methods in a single class Finding the current application which has focus. |
|||||||||||||||||||||||