0

I have been trying to filter [HMR] * messages in devtools with these regex

  • /^(?!\[HMR\]).*$/
  • /^(?!\[HMR\]).*$/gm

enter image description here

However with these regex it did found the things I need, Regex101. Images can be found below Php flavor: enter image description here

Javascript flavor: enter image description here

Azriz
  • 3,122
  • 2
  • 12
  • 13
  • You are matching [WDS] and the like because you are trying to find "not starting with HMR". I don't see nothing wrong here. Could you please clarify? – Julio Jul 30 '18 at 07:17
  • 3
    Simply use `-[HMR]` – wOxxOm Jul 30 '18 at 07:48
  • Thank you man it works, @wOxxOm . But may i know why my regex doesnt work on devtool filter. – Azriz Jul 30 '18 at 14:06
  • Sounds like a bug. Consider reporting on https://crbug.com – wOxxOm Jul 30 '18 at 14:12
  • My guess is that you're using a RegEx pattern that is not fully supported in JavaScript. For example, in the RegEx testing tool that you took a screenshot of, you're using a PHP flavor of RegEx. Try using the JavaScript flavor, instead. – Kayce Basques Jul 30 '18 at 19:42
  • Hi @KayceBasques, I did try your suggestion but the outcome are still the same. Thank you – Azriz Jul 31 '18 at 08:55

1 Answers1

2

You can use a special Chrome filter syntax for removing lines like that:

-[HMR]

and

-[WDS]

This removes all lines matching [HMR] and [WDS] without using regex.

TankorSmash
  • 12,186
  • 6
  • 68
  • 106