Forum Discussion

Robert_47833's avatar
Icon for Altostratus rankAltostratus
Aug 18, 2011

how to match string1?string2?

there is a string start with /cjj?cjj2,how to match it?




$uri matches_regex "^/cjj?cjj2"




{ persist none


HTTP::redirect ""




does "?" can be matched in matches_regex?


or do we have other method to achieve this?



3 Replies

  • If I insist on using match_regex,


    $uri match_regex "^/cjj?cjj2"


    does it work?
  • Sure if you put a \ in front of the ? otherwise it represents any non-whitespace character. Its worth noting that any regex matching is significantly slower that's why there are many alternatives.



    Kevin (Jarvil)