Burp community forum

Chaining regexes

Maple | Last updated: Jul 31, 2019 05:03PM UTC

Does regex engine in Burp support look-forward regex syntax? I can't get it to work. Suppose I have a text Cookie: xb=451079; localization=en-us%3Bcz%3Bcz; liqpw=1280; liqph=1173; Now I want to match "localization" string only if it's followed by "liqpw" on the same line. The regex for this should be localization(?=.*)(?=liqpw) But I'm getting 0 search results. If the forward-lookup syntax is not available - is there any workaround?

Patrick, PortSwigger Agent | Last updated: Aug 02, 2019 08:17AM UTC

Positive lookahead is supported but I think that there may be an error with your regular expression. I tested your pattern and the cookie text on https://regex101.com/ I would suggest using localization.*liqpw instead. This should only match if 'localization' and 'liqpw' are on the same line. Burp should support the same regular expression syntax as Java: https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html Please let us know if you need any further assistance.

You need to Log in to post a reply. Or register here, for free.