The "\s" is a shorthand character class that matches any whitespace -
spaces, tabs and newlines.

In your case, if you only want to match spaces, you can simply use a
space in the Regex instead of the "\s". The Regex would then become:

STRT[ ]+\.

Hope this helps.


On Jun 21, 10:56 am, ankit m a cool dude with hot atitude
<[email protected]> wrote:
> @lightrain
> This is what I am also trying to do but the problem is when using \s, it
> will take \n and \t as spaces. But I want to exclude \n and \t. I just want
> to take spaces.
>
> Suppose the file is like:
>  STRT       .          somedata          STRT
>  .RUN
>
> Here only first match should be returned. But if we run the code you
> specified, two matches will be returned. The 2nd match being STRT in first
> line and . in next.
>
> Is there any solution to avoid this?

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to