Skip to content

Instantly share code, notes, and snippets.

@keithwongg
Last active July 24, 2024 09:40
Show Gist options
  • Select an option

  • Save keithwongg/1cd6d9a74c865dff5e3a0748029ed278 to your computer and use it in GitHub Desktop.

Select an option

Save keithwongg/1cd6d9a74c865dff5e3a0748029ed278 to your computer and use it in GitHub Desktop.
Regex

Notepad++

Search 2 keywords in the same line

Join 2 keywords with .*

Example:

22/07/2024 11:20:00 +08:00 HTTP "PUT" "/user" responded 500 in 361.2326 ms

Want all instances of PUT requests for endpoint /user.

Notepadd++ > Find > Find what > Input regex

PUT".*user

Sublime Text

Search for a string that contains "api/user" and "SERVER-STATUS=500"

(?=.*api/user)(?=.*SERVER-STATUS=500)\w+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment