Regular expression for the following sentence?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Colin Rodrigues
    New Member
    • Dec 2010
    • 16

    Regular expression for the following sentence?

    string strcookie = "|Lat=17.66|Lon gi=18.66|fav=ci ne|";


    I need to get 17.66 when i pass "Lat" in the parameter
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    You don't need to use Regular Expressions for splitting key value paired data.

    You can use Split() function of string to get the data in a array.
    like or you can use the clsKeyValuePars er class.
    like you use it in you're projects.

    Comment

    • Colin Rodrigues
      New Member
      • Dec 2010
      • 16

      #3
      thanks...i already knew about the split function...howe vr i wanted to go thru the regular expression way

      Comment

      • HaLo2FrEeEk
        Contributor
        • Feb 2007
        • 404

        #4
        That's a waste of resources. Split is going to be much quicker and easier than regular expressions. No sense bogging down your software just because you want to do it a certain way.

        Comment

        • Colin Rodrigues
          New Member
          • Dec 2010
          • 16

          #5
          thnks for ur help anywayz..i've already got it solved...but thnx 4 ur tym...cheers

          Comment

          Working...