REGEX Help

masterit

Active member
  • Feb 19, 2014
    566
    145
    43
    elakiri.com/forum/newthread.php?do=newthread

    මේ වගේ URL එකක parameter එකක් exists වෙලා නැද්ද කියල(eg: "do" param එක නැද්ද කියල) regex වලින් චෙක් කරන්න දන්නවද කවුරු හරි.
     
    Last edited:

    masterit

    Active member
  • Feb 19, 2014
    566
    145
    43
    This regex will capture the "?do" string as a capture group.

    Code:
    .*(\?do).*


    Question is very vague to give a precise answer.

    thanks මචං.
    මට වැරදුණා . මට ගන්න ඕනි param එක exist වෙලා නැද්ද කියල check කරන්න. google analytics වල custom report වලට.

    දන්නවද ක්‍රමයක්
     

    Djice

    Well-known member
  • Jan 17, 2011
    4,410
    3,779
    113
    out of fucked up land
    This will get whatever after '?do=' as a capture group and you can assign it to a variable.
    Then I guess you can check if there is a value or the variable is an empty string.
    Code:
    ^.*\?do=(.*)$
     
    Last edited:

    masterit

    Active member
  • Feb 19, 2014
    566
    145
    43
    This will get whatever after '?do=' as a capture group and you can assign it to a variable.
    Then I guess you can check if there is a value or the variable is an empty string.
    Code:
    ^.*\?do=(.*)$

    හරිගියෙ නෑ මචන්. මේක දැම්මත් එන්නේ do param එක තියෙන result ටික විතරයි. do param එක නැති page url ටිකයි ගන්න ඕනෙ
     

    masterit

    Active member
  • Feb 19, 2014
    566
    145
    43
    වැඩේ ගොඩ මචන්ල. "not": "True" (exclude) කියල option එකක් analyticsවල තියෙනව. මන් ඒක කලින් දැක්කෙ නැහැ.