RegEx usage in Java - HttpProtocolBuilder DenyList

I’m trying to filter the following call , using DenyList . Validated the regex here on regex101 :

The DenyList works for the other regex’s used in the method DenyList() , however ".*\\.dcss;mod=\\d+(?:[-+]?\\d+)e?" does not get applied. What am I doing wrong here ?

Thats the call I want to filter out :

https://perf.bbb.ondemand.com/public/ui-dcss/SFSALRF/_/3q!6dd1oy6jh8!!ojy=15C!011XKXKT1NONORNPRPT!10!0-1!PL3i!1=LPZ0!4NN8SL0qSlB7NYv1-1!y8Db0!MYjB-1!1!!1-1!-1!-1!110!-1!XKXKRJrmMc30Gc__RJrmMc306nw!8y8y7az!!10!-1!Gc__0!6nw!-1!-1!0!6nw!0!52P!F20ldDR=thpb16nIR-1!6nIRr=ag0!6nIRSKbCJbiQSKbC0+0+1px+0!10!-1!-1!-1!HaKHHaKHRZrmmlBp0!1-1!SL1-1!Gc__0!0!-1!0!0!6nw!!0!-1!6nw!COAD-1!COADSLSDSLSL___Ma2BS=XQZSL1WF0!BORNPLPC!14h4O-1!6nw!SL17xMv0!dDR=F20lt9gHthpbRCgEoziCdcaCh==lvIZIwKJG0!mqN!-1!t9gHF20lRCgE1-1!0!8Xc!!!!1-1!11Gc__0!6nw!VL7_0!McvcSKbCJbiQSKbC0+0+1px+0!011!DERBPLPT!NO0!SD1!T1!DE1ejAV!3wUe3wUe!3wUepStD!!!SL!10!0!__HWc30MG!4jFp_vzUqbY0COADt9gH1DE!DE!1-1!!-1!-1!a6WQ!DE1qSJH6nw!!0!Mc301!L=5Rt!/.dcss;mod=1002131e

import io.gatling.javaapi.core.*;
import io.gatling.javaapi.http.*;

import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.*;

public class LoginSimulation extends Simulation {

  private HttpProtocolBuilder httpProtocol = http
    .baseUrl("https://pre.cm.onmand.com")
          .inferHtmlResources(AllowList(),
                  DenyList(".*\\.js", ".*\\ \n" +
                                  ".*\\.dcss;mod=\\d+(?:[-+]?\\d+)e?",".*\\.css", ".*\\.gif", ".*\\.jpeg", ".*\\.jpg",
                          ".*\\.ico", ".*\\.woff", ".*\\.woff2", ".*\\.(t|o)tf", ".*\\.png", ".*\\.svg",
                          ".*detectportal\\.firefox\\.com.*"))
    .acceptHeader("*/*")
    .acceptEncodingHeader("gzip, deflate")
    .acceptLanguageHeader("en-US,en;q=0.9")
    .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36");
  



  private ScenarioBuilder scn = scenario("SimulationLogin")
    .exec(
      http("T01_Login")
        .post("/login")
        .formParam("bplte_userid", "")
        .formParam("comp", "Hioala")
        .formParam("user", "thill")
        .formParam("pass", "rxxx20")
    );

  {
	  setUp(scn.injectOpen(atOnceUsers(1))).protocols(httpProtocol);
  }
}

P.S : I did review a similar solution.

Hi @alferd_nobel,

Welcome aboard!
Note that this question is not specifically a gatling one. (only about regex).

To begin with, let’s begin with taking only the part we are interested in:

                  DenyList(".*\\.js", ".*\\ \n" +
                                  ".*\\.dcss;mod=\\d+(?:[-+]?\\d+)e?",".*\\.css", ".*\\.gif", ".*\\.jpeg", ".*\\.jpg",
                          ".*\\.ico", ".*\\.woff", ".*\\.woff2", ".*\\.(t|o)tf", ".*\\.png", ".*\\.svg",
                          ".*detectportal\\.firefox\\.com.*")

Let’s reformat that, to have a clearer view:

DenyList(
  ".*\\.js",
  ".*\\ \n" + ".*\\.dcss;mod=\\d+(?:[-+]?\\d+)e?",
  ".*\\.css",
  ".*\\.gif",
  ".*\\.jpeg",
  ".*\\.jpg",
  ".*\\.ico",
  ".*\\.woff",
  ".*\\.woff2",
  ".*\\.(t|o)tf",
  ".*\\.png",
  ".*\\.svg",
  ".*detectportal\\.firefox\\.com.*"
)

Do you see the issue now?

My suggestion: remove this prefix

Cheers!

Thanks that helped !