• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Anyone any good at regexp?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Anyone any good at regexp?

    I hate it. Probably cos I don't understand a flipping word.

    Very powerful though.

    So can anyone help?
    Knock first as I might be balancing my chakras.

    #2
    Originally posted by suityou01 View Post
    I hate it. Probably cos I don't understand a flipping word.

    Very powerful though.

    So can anyone help?
    google turns up most of the patterns you need

    Comment


      #3

      Comment


        #4
        Originally posted by mudskipper View Post
        google turns up most of the patterns you need
        Seriously farking isn't which is why I asked on here.

        Code:
        FolderGUID:67bfabff-ad78-4d30-918e-811dd2636f83 Outcome:Accept DataItem:SomeData
        So I want to parse this.

        How would you google that?

        I have tried :

        RegExp get characters after string literal.
        RegExp get characters before space.
        RegExp get characters between two strings.

        Going mucking fental here.
        Knock first as I might be balancing my chakras.

        Comment


          #5
          Originally posted by suityou01 View Post
          Seriously farking isn't which is why I asked on here.

          Code:
          FolderGUID:67bfabff-ad78-4d30-918e-811dd2636f83 Outcome:Accept DataItem:SomeData
          So I want to parse this.

          How would you google that?

          I have tried :

          RegExp get characters after string literal.
          RegExp get characters before space.
          RegExp get characters between two strings.

          Going mucking fental here.
          This is what google says on that question...

          https://www.google.co.uk/search?q=pa...YBA&gws_rd=ssl
          'CUK forum personality of 2011 - Winner - Yes really!!!!

          Comment


            #6
            Originally posted by suityou01 View Post
            Seriously farking isn't which is why I asked on here.

            Code:
            FolderGUID:67bfabff-ad78-4d30-918e-811dd2636f83 Outcome:Accept DataItem:SomeData
            So I want to parse this.

            How would you google that?

            I have tried :

            RegExp get characters after string literal.
            RegExp get characters before space.
            RegExp get characters between two strings.

            Going mucking fental here.
            I wouldn't be using regex for that. What language?

            Comment


              #7
              Originally posted by mudskipper View Post
              I wouldn't be using regex for that. What language?
              C hash
              Knock first as I might be balancing my chakras.

              Comment


                #8
                Originally posted by suityou01 View Post
                C hash
                I was going to help you, but just because you said C hash and not C SHARP, I am not going to

                Comment


                  #9
                  Code:
                  string suityString = "FolderGUID:67bfabff-ad78-4d30-918e-811dd2636f83 Outcome:Accept DataItem:SomeData";
                  string[] suityData = suityString.Split(' ');
                  
                  Dictionary<String, String> suityDict =
                                  new Dictionary<string, string>();
                  
                  foreach (string pair in suityData)
                  {
                        suityDict.Add(pair.Split(':')[0], pair.Split(':')[1]);
                  }

                  Comment


                    #10
                    Originally posted by mudskipper View Post
                    Code:
                    string suityString = "FolderGUID:67bfabff-ad78-4d30-918e-811dd2636f83 Outcome:Accept DataItem:SomeData";
                    string[] suityData = suityString.Split(' ');
                    
                    Dictionary<String, String> suityDict =
                                    new Dictionary<string, string>();
                    
                    foreach (string pair in suityData)
                    {
                          suityDict.Add(pair.Split(':')[0], pair.Split(':')[1]);
                    }
                    Nice. So who do I store this code in the database?

                    I think they call this the XY problem.
                    Knock first as I might be balancing my chakras.

                    Comment

                    Working...
                    X