using expressions

Regular expressions are not used to find exact words, although they can be, they are just too complicated for that. They are used to find patterns in the text and they are not very easy to use.

I suggest looking this topic up on the net unless you have a specific question about an expression.

Although I did make an expression that found an exact string...I dont know what I was thinking.
C#:
/// <summary>
/// Matches all occurances of an exact word.  Each match is located in a group called G.
/// </summary>
public static MatchCollection FindExact(ref string text, string find)
{
   MatchCollection mc = Regex.Matches(text, @"\W" + "(?<G>" + find + ")" + @"\W");
   return mc;
}
You or I could replicate this with a loop to find all exact matches of a word.
 
Last edited by a moderator:
Originally posted by Winston
can could u help me make one that validates a string is the form of http:// as the beginning and the rest can be anything

[VB]
If YourStringVar.StartsWith("http://") Then
-YourStringVar is OK...
End If
[/VB]
 
Back
Top