regex - regular expressions

regex zip code 5 or 9 digits for "complete" ASP.NET zip code text box

Here is an example of Asp.NET Web page - "complete" zip code text box 1) regex for xxx -> ="^(\d{5}|\d{5}\-\d{4})" 2) zip code text box with a) regex RegularExpressionValidator b) RequiredFieldValidator <asp:TextBox ID="txtZip" runat="server" MaxLength="10" Width="100px" ></asp:TextBox> <asp:RegularExpressionVa... ID="RequiredFieldValidatorZip" ControlToValidate="txtZip" ValidationExpression="^(\d{... ErrorMessage="Zip code must be numeric nnnnn or nnnnn-nnnn."...

c# regex email address

original artickle: http://www.cambiaresearch.c... public bool TestEmailRegex(string emailAddress) { // string patternLenient = @"\w+([-+.]\w+)*@\w+([-.]\w... // Regex reLenient = new Regex(patternLenient); string patternStrict = @"^(([^<>()[\]\\.,;:\... + @"(\.[^<>()[\]\\.,;:\... + @"((\[[0-9]{1,3}\.[0-9]{1,3... + @"\.[0-9]{1,3}\])|(([a-zA-Z...

fiinding a substring like "ON" (or with wildcard <.> like ".N" in a bigger string like "YONDER"

Private Function PassesSubstringTest(ByVal myWord As String, ByVal myFragment As String, ByVal matchType As MatchType) As Boolean If myWord = "REDON" Then System.Diagnostics.Debug.Pr... End If '--------------------------... 'anything to do? '--------------------------... If myFragment = "" Then '--------------------------... 'no, return "matched:...