Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

what does the following regex mean?

Last post 06-23-2009, 9:40 AM by ddrudik. 1 replies.
Sort Posts: Previous Next
  •  06-23-2009, 6:53 AM 54236

    what does the following regex mean?

    Hi,

     I came across the following  regex but could not understand what does this mean.

    %7B[a-zA-Z]+_?-?[a-zA-Z]+%7D

     

    please help. I use C# 2.0

    Can comeone post a tut on all the symbols used in regex..? if one already exists please point me to it.

    Cheers...! 

  •  06-23-2009, 9:40 AM 54240 in reply to 54236

    Re: what does the following regex mean?

    Match Pattern Explanation:
    The regular expression:

    (?-imsx:%7B[a-zA-Z]+_?-?[a-zA-Z]+%7D)

    matches as follows:
     
    NODE                     EXPLANATION
    ----------------------------------------------------------------------
    (?-imsx:                 group, but do not capture (case-sensitive)
                             (with ^ and $ matching normally) (with . not
                             matching \n) (matching whitespace and #
                             normally):
    ----------------------------------------------------------------------
      %7B                      '%7B'
    ----------------------------------------------------------------------
      [a-zA-Z]+                any character of: 'a' to 'z', 'A' to 'Z'
                               (1 or more times (matching the most amount
                               possible))
    ----------------------------------------------------------------------
      _?                       '_' (optional (matching the most amount
                               possible))
    ----------------------------------------------------------------------
      -?                       '-' (optional (matching the most amount
                               possible))
    ----------------------------------------------------------------------
      [a-zA-Z]+                any character of: 'a' to 'z', 'A' to 'Z'
                               (1 or more times (matching the most amount
                               possible))
    ----------------------------------------------------------------------
      %7D                      '%7D'
    ----------------------------------------------------------------------
    )                        end of grouping
    ----------------------------------------------------------------------

    http://www.regular-expressions.info/tutorial.html
View as RSS news feed in XML