Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Regular Expressions
  4. Need help with Regular expression

Need help with Regular expression

Scheduled Pinned Locked Moved Regular Expressions
regexhelpquestion
3 Posts 3 Posters 13 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_16012634
    wrote on last edited by
    #1

    I have different file name pattern as follows. ABCD_ABCDEFGH_PARB_ALLB_CCYYMMDD-HHMMSS.TXT SDCD_NKEDHEI_ALLIA_PARTN_CCYYMMDD-HHMMSS.TXT UN_URKSLJIE_EXTRACT_DATA_ALLT_PART_CCYYMMDD-HHMMSS.TXT And I was trying to use the following regex expression but it doesn't work all types of file names as above ... ^.*_(ALLB|ALLIA|ALLT|AMERI|BCBS|CCH|EASB|EASTP|EAST|SANDH|SANT|SANB|TRIB|TRILL|TRIT|UHC|VAYAH|VAYT|VAYB|WELLC)(?_PARTN|?_PART)_\d{8}-\d{6}"\.TXT$ Can someone help me with this?

    P J 2 Replies Last reply
    0
    • M Member_16012634

      I have different file name pattern as follows. ABCD_ABCDEFGH_PARB_ALLB_CCYYMMDD-HHMMSS.TXT SDCD_NKEDHEI_ALLIA_PARTN_CCYYMMDD-HHMMSS.TXT UN_URKSLJIE_EXTRACT_DATA_ALLT_PART_CCYYMMDD-HHMMSS.TXT And I was trying to use the following regex expression but it doesn't work all types of file names as above ... ^.*_(ALLB|ALLIA|ALLT|AMERI|BCBS|CCH|EASB|EASTP|EAST|SANDH|SANT|SANB|TRIB|TRILL|TRIT|UHC|VAYAH|VAYT|VAYB|WELLC)(?_PARTN|?_PART)_\d{8}-\d{6}"\.TXT$ Can someone help me with this?

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Maybe the " in -- {6}"\. Unsure what the second ? is doing in -- (?_PARTN|?_PART) Edit: (?_PARTN|?_PART) should maybe be (_PARTN?)?

      1 Reply Last reply
      0
      • M Member_16012634

        I have different file name pattern as follows. ABCD_ABCDEFGH_PARB_ALLB_CCYYMMDD-HHMMSS.TXT SDCD_NKEDHEI_ALLIA_PARTN_CCYYMMDD-HHMMSS.TXT UN_URKSLJIE_EXTRACT_DATA_ALLT_PART_CCYYMMDD-HHMMSS.TXT And I was trying to use the following regex expression but it doesn't work all types of file names as above ... ^.*_(ALLB|ALLIA|ALLT|AMERI|BCBS|CCH|EASB|EASTP|EAST|SANDH|SANT|SANB|TRIB|TRILL|TRIT|UHC|VAYAH|VAYT|VAYB|WELLC)(?_PARTN|?_PART)_\d{8}-\d{6}"\.TXT$ Can someone help me with this?

        J Offline
        J Offline
        jschell
        wrote on last edited by
        #3

        Use code tags when you post code on this site. Why there is a double quote in what you posted?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups