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. Web Development
  3. Hi need Reg Ex help

Hi need Reg Ex help

Scheduled Pinned Locked Moved Web Development
regexhelp
2 Posts 2 Posters 0 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.
  • V Offline
    V Offline
    Vikram
    wrote on last edited by
    #1

    Hi i need to check pattern of a file name using Regular Expression. The file name is something like "TRANS#7_26_2007.xls" ie "TRANS#[MM]_[DD]_[YYYY].xls" Can any one please help me.... Thanks,....

    Vikram I Code...

    A 1 Reply Last reply
    0
    • V Vikram

      Hi i need to check pattern of a file name using Regular Expression. The file name is something like "TRANS#7_26_2007.xls" ie "TRANS#[MM]_[DD]_[YYYY].xls" Can any one please help me.... Thanks,....

      Vikram I Code...

      A Offline
      A Offline
      andyharman
      wrote on last edited by
      #2

      Hi Vikram I think the pattern you need is TRANS#\d{1,2}_\d{1,2}_\d{4}\.xls. The "\d" matches any numeric character. The "{x,y}" pattern matches the preceding character between x and y times (i.e. your example showed that the months may be expressed as a single digit). The "{4}" pattern matches the preceding character exactly 4 times. The "\" says to treat the following character as a literal (because "." is a special matching character). Hope that helps. Regards Andy I code too...

      If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".

      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