more egrep help

Clovertech Forums Read Only Archives Cloverleaf General more egrep help

  • Creator
    Topic
  • #51366
    Andrew Deters
    Participant

      i need a regex to return all the matches for the following:

      “PM|04665|||20091103004500||ADT^A23|”

      “PM|04665|||20091103004533||ADT^A29|”

      “PM|04665|||20091123012323||ADT^A34|”

      Any help is appreciated.

    Viewing 2 reply threads
    • Author
      Replies
      • #69900

        Andrew Deters wrote:

        i need a regex to return all the matches for the following:

        “PM|04665|||20091103004500||ADT^A23|”

        “PM|04665|||20091103004533||ADT^A29|”

        “PM|04665|||20091123012323||ADT^A34|”

        Any help is appreciated.

        Try this:

        Code:

        egrep ‘PM|04665|||[0-9]{14,14}||ADT^A(23|29|34)|’

        -- Max Drown (Infor)

      • #69901
        Andrew Deters
        Participant

          thanks worked like a charm

        • #69902

          Andrew Deters wrote:

          thanks worked like a charm

          If I may make a suggestion that may or may not make your life easier: instead of writing long, complicated regexp, try stringing some pipes together like this …

          egrep ‘04665’ | egrep ‘ADT’ [code]egrep ‘04665’ | egrep ‘ADT’

          -- Max Drown (Infor)

      Viewing 2 reply threads
      • The forum ‘General’ is closed to new topics and replies.