Loading ...
Sorry, an error occurred while loading the content.

Re: [webanalytics] Google analytics RegEx issue

Expand Messages
  • Utku Can Top├žu
    It would be easier if you had put some more strings to analyze the pattern. Assuming the pattern is something like: /x-x-x-x-x-x/
    Message 1 of 3 , Sep 8, 2010
    • 0 Attachment
      It would be easier if you had put some more strings to analyze the pattern.

      Assuming the pattern is something like:
      /x-x-x-x-x-x/
      /[^-]*-[^-]*-[^-]*-[^-]*-[^-]*-([a-z])*[0-9]*

      than group(1) is what you're looking for

      On Tue, Sep 7, 2010 at 3:53 AM, amitonebit <amit.ohayon@...> wrote:

      >
      >
      > Hi,
      >
      > Can anyone help with the right syntax for the following?
      >
      > What i need is, to take out the "city" out of the string:
      >
      > /h-c990-e0-p0-l0-city8300/
      >
      >
      >


      [Non-text portions of this message have been removed]
    • Phil
      Also try... ^/(.+?-.+?-.+?-.+?-.+?)-city(.+?)/ /$A1-A$2/ Or... ^/([^-]+-[^-]+-[^-]+-[^-]+-[^-]+)-[a-z]+([0-9]*)/ /$A1-A$2/ Thanks Phil.
      Message 2 of 3 , Sep 10, 2010
      • 0 Attachment
        Also try...

        ^/(.+?-.+?-.+?-.+?-.+?)-city(.+?)/
        /$A1-A$2/

        Or...

        ^/([^-]+-[^-]+-[^-]+-[^-]+-[^-]+)-[a-z]+([0-9]*)/
        /$A1-A$2/

        Thanks

        Phil.
      Your message has been successfully submitted and would be delivered to recipients shortly.