Question

I want to remove text from a log-file with regular expression.

  • everything before: logger=
  • everything after: ):
backup.log (logger=org.brother.powerlab.database.backup): Log database backup
upgrade.log (logger=org.brother.powerlab.database.upgrade): Log database upgrade
clean.log (logger=org.brother.powerlab.database.clean): Log database cleanup
speedtest.log (logger=org.brother.powerlab.database.speedtest): Log database speedtest
statistics.log (logger=org.brother.powerlab.database.statistics): Log database statistics

This can be done with notepad++ with 2 regular expressions.

How to do this with 2 regular expressions? Thanks!

Was it helpful?

Solution

This can be done by single regex find and replace.

  • Find what: .*(logger=.*\):).*

  • Replace with: $1

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top