#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2010
    Posts
    126
    Rep Power
    9

    C#_ modification required


    Hello every one...

    This is what my string(text) looks like in MS visual c# 2010.
    Code:
    "Date/Time\t03/06/2010 09:35:47"
    This string is found while reading a text file.(I created streamReader object and used ReadLine() method)

    Now,

    this expression (i hope) will pick up following pattern. "03/06/2010"

    Code:
    ^\d{1,2}\/\d{1,2}\/\d{4}$
    I want to modify this expression such that it doesnt care if anything else exists at the start or end of the line, currently being read by my streamReader object.

    Please help.

    Thanks
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,692
    Rep Power
    6351
    ^ anchors an expression to the beginning of a string.
    $ anchors an expression to the end of a string.

    Remove them both, and you'll stop being anchored.

    -Dan
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo