Topic
  • 2 replies
  • Latest Post - ‏2014-06-11T05:33:53Z by abinya Balaji
abinya Balaji
abinya Balaji
92 Posts

Pinned topic PCRE match for error code

‏2014-05-23T05:53:21Z |

Hello all

I want to execute an error rule for all error codes other than 0x00030001, How should I achieve this by using PCRE Expression?

I refered this link https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14576252#14575855

and tried something like  this
^(?!0x00030001)[0-9.]+$

but this is not working. Could anyone help on this? Thanks in advance.

 

  • HermannSW
    HermannSW
    6212 Posts

    Re: PCRE match for error code

    ‏2014-05-23T09:53:50Z  

    Hi

    I was sceptical at first, but after seeing the "Match with PCRE" toggle on Matching Rule level it was clear that PCRE can be done for all match types including "Error Code". So first you have to set this toggle to "On".

    And then this regexp will match all error codes but the one you want to avoid:

    (?!0x00030001)0x.*
    

    This reqexp makes use of Negative Lookahead, a nice regexp feature I used to fix APAR IC72220 in firmware code 3 years ago as well.

    You did try to use it in your attempt above, but missed to match for 0x (the negative lookahead does not move the regexp match pointer).


    Hermann <myBlog/> <myTweets/> | <GraphvizFiddle/> | <xqib/> | <myCE/> <myFrameless/>

    Updated on 2014-05-23T09:59:09Z at 2014-05-23T09:59:09Z by HermannSW
  • abinya Balaji
    abinya Balaji
    92 Posts

    Re: PCRE match for error code

    ‏2014-06-11T05:33:53Z  

    Hi Hermann,

    Thanks a lot , this worked . Sorry for late reply.