question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot match url with query parameters when both contain regular expressions

See original GitHub issue

the following stub mapping:

{
  "request" : {
    "urlPath" : "/partners/[0-9]+/agents/[0-9]+/reports/loans/DAILY",
    "method" : "GET",
    "queryParameters" : {
      "page" : {
        "matches" : "[0-9]+"
      },
      "per_page" : {
        "matches" : "[0-9]+"
      }
    }
  },
  "response" : {
    "status" : 200
  }
}

cannot match /partners/1/agents/1/reports/loans/DAILY?page=1&per_page=10

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16

github_iconTop GitHub Comments

1reaction
JeremyLoycommented, Sep 12, 2019

The example in this documentation still uses urlPath.

0reactions
tomakehurstcommented, Sep 12, 2019

If you’re having trouble getting a stub to match I suggest posting a question on the mailing list with full code, configuration and the request you’re making.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot match url with query parameters when both contain ...
Ah, I see the problem - you're using urlPath which is for an exact match, not regex. urlPathMatching should do it.
Read more >
Regex to match specific path with specific query param
I'm struggling with creating regex to match URL path with query param that could be in any place. ... This regex works only...
Read more >
Query parameter targeting - Optimize Resource Hub
URLs can contain multiple query parameters, called query components. ... Regex matches are useful when the stem, trailing parameters, or both, ...
Read more >
How to Use Regular Expressions for Page Targeting and IP ...
A Regular Expression, REGEX, is a special text string for describing a search pattern. Within Hotjar, you can use Regular Expressions to target...
Read more >
Working with regex match conditions - AWS Documentation
A regex match condition is a type of string match condition that identifies the pattern ... Any parameter that you have defined as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found