Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XML regular expression for case statment

    One of the tool we use reads a XML file to generate the number of lines of code from given source files types (like.. java,sql etc..). Below is the line of code wirtten in the XML file which is used to ignore the lines in source files which have only the words "do" or "while".

    <codeArea name="Begin/End tags" isCode="false" >
    <expression>^\s*begin\s*$</expression>
    <expression>^\s*end\s*$</expression>
    </codeArea>

    In the same way, how can I write the code to ignore the "case" statements which is used with "switch" in programming languages. For example, in the below code i want to ignore "case" statements


    switch ((char)(e.KeyChar))

    {
    case '\b':
    case "Thr":
    case '1':
    }

    I tried below way, but it doesn't worked. could someone please help on it.


    <expression>^\s*case[*]:\s*$</expression>

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,460
    Thanks
    1
    Thanked 23 Times in 21 Posts
    This is more a question for the language you're using to preprocess the XML. What language is that?
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •