Skip to content

Commit

Permalink
switch to longer regex bc more performant
Browse files Browse the repository at this point in the history
  • Loading branch information
c298lee committed Oct 24, 2024
1 parent 6a8386a commit 6e82fd4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function toSearchTerm(transaction) {
// ([{]([^\/]*)[}]) matches {param} used by ASP.NET Core, Laravel, Symfony
// ([<]([^\/]*)[>]) matches <param> used by Flask, Django
const parameterizedRegex =
/ ([\/]) (([:]([^\/]*)) | ([\[]([^\/]*)[\]]) | ([{]([^\/]*)[}]) | ([<]([^\/]*)[>])) /g;
/([\/])(([:]([^\/]*))|([\[]([^\/]*)[\]])|([{]([^\/]*)[}])|([<]([^\/]*)[>]))/g;
modifiedTransaction = modifiedTransaction.replaceAll(parameterizedRegex, '/*');

// transaction name could contain the resolved URL instead of the route pattern (ie actual id instead of :id)
Expand Down

0 comments on commit 6e82fd4

Please sign in to comment.