2 Replies Latest reply: Apr 17, 2009 7:14 AM by 807588 RSS

    ReplaceAll REGEX Help!

    807588
      I would like to convert a String and preserve the ORA-12345 , get ride of digits and deal with the various lengths of XX-XX-XX or XX-XX-XX-XX:

      "This is an oracle 9999 Error ORA-12345 Application Error code: 567B-2345 SubCode: 123-456-789-ABC"

      to:

      "This is an oracle ? Error ORA-12345 Application Error code: ? SubCode: ?"

      I've tried many expressions but never seem to crack it.

      This is a start but no way enough.
      myRecord.replaceAll("\\b(?!ORA-)\\b([A-Z|0-9]+[-][A-Z|0-9]+);{code}
      
      Any tips appreciated.