in reply to Re: regfular expression hlep
in thread regfular expression hlep

<expression>^\s*case\s+.*?:\s*$</expression> the abvove lines in the xml file makes the tool to ignore all the lines which are having only the word " case : ". For example all below lines will get ignored. case 1: case 2: case ABC: now, i want the same code for ignoring the any line which starts with " : " (colon). Example, :END ---> this line should be ignored :STOP ---> this line should be ignored

Replies are listed 'Best First'.
Re^3: regfular expression hlep
by CountZero (Bishop) on Jun 14, 2012 at 06:11 UTC
    If you want three separate regexes, just split the combined one at the | symbol:

    • /^\s*case [^:]*:/ (I have amended this to conform to your examples)
    • /^:/
    • /^struct/

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics