• 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

    #21
    AFAICS you haven't once mentioned yet what data you want out of that text string.

    (although presumably the aim is to extract every useful field)
    Work in the public sector? Read the IR35 FAQ here

    Comment


      #22
      Originally posted by OwlHoot View Post
      AFAICS you haven't once mentioned yet what data you want out of that text string.

      (although presumably the aim is to extract every useful field)
      Or what you're doing with the data once it's extracted - where does the database come into things?

      Comment


        #23
        Originally posted by suityou01 View Post
        The structure of the data can be anything
        What does this mean?

        If you don't know the structure, you can't parse it using regex or anything else.

        Comment


          #24
          so are you just looking for a recognisable string somewhere in a larger string?

          Comment


            #25
            OK. Some bizarre questions (not you Owly that was quite astute).

            I want to listen for an email. Then strip data out of it. I want the system to be configurable so that the pattern matching "stuff" lives in the database.

            So ClientCo then say, right we need a new template I'm not having to roll out a new exe for them.

            So incomes the email. Check the subject line, or address it was sent to or whatever you like, to identify which template to get from the database.

            Then get the template from the database.

            Then use this template to parse the email for data. Then build a comma delimited string of this data. In the order it occurs in the email.

            That's it. No more, no less.

            So if client co then turn up and say, right Suity we want an email that says

            "Apples: 2 Bananas:3 Pears:4" I say sure no problem, just bung a row in that table over there with xyz reg exp.
            Knock first as I might be balancing my chakras.

            Comment


              #26
              And I don't feel like I've drip fed anything. My original question was, can someone give me some regexp to parse this specific string. No more, no less.
              Knock first as I might be balancing my chakras.

              Comment


                #27
                Originally posted by original PM View Post
                so are you just looking for a recognisable string somewhere in a larger string?
                In this case it's more about the colons I think.

                Thisisalargestring: And here is some data up until the next space character Thisisanotherlargestring: And here is some more data

                Some regxp that turns that lot into

                Group1[And here is some data up until the next space character]
                Group2[And here is some more data]

                Would be absolutely magic. And worth 6 pints.
                Knock first as I might be balancing my chakras.

                Comment


                  #28
                  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?
                  Originally posted by suityou01 View Post
                  And I don't feel like I've drip fed anything. My original question was, can someone give me some regexp to parse this specific string. No more, no less.
                  No you didn't
                  Brexit is having a wee in the middle of the room at a house party because nobody is talking to you, and then complaining about the smell.

                  Comment


                    #29
                    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.
                    Awk or cut.

                    Comment


                      #30
                      Originally posted by suityou01 View Post
                      In this case it's more about the colons I think.

                      Thisisalargestring: And here is some data up until the next space character Thisisanotherlargestring: And here is some more data

                      Some regxp that turns that lot into

                      Group1[And here is some data up until the next space character]
                      Group2[And here is some more data]

                      Would be absolutely magic. And worth 6 pints.
                      Yeah I was a PM so have no technical knowledge at all...

                      but when will it be completed by I have a box to tick?

                      Comment

                      Working...
                      X