简体   繁体   中英

Notepad++ regular expression invalid

I've been hacked on some of my websites with code injection. I'm trying to find a line that contain part of the code injection with notepad++. Unfortunatly my regex does not work on notepad++: I'm trying to work with this :

/^ *(.*(?:\$qV\=\"stop\").*) *$/igm

Notepad++ throw invalid regular expression :'(

I'm trying to find a line that contains $qV="stop"

EDIT : ok it's working but it doesnt find the text

You need to use the following regex:

^.*\$qv="stop".*

It will match the whole lines containing $qv="stop" .

Note that Notepad++ treats ^ / $ anchors as line start/end anchors, and thus you do not need to specify the /m modifier.

Also, /i case-insensitive mode can be set with Match Case option. Uncheck it to use case-insensitive search mode.

A global search and replace is also performed using Notepad++ specific operation ( Replace All button), thus, /g modifier is redundant.

Regex delimiters are not used, and thus are treated as literals (together with the modifiers).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM