Regular expression using negative lookbehind not working in Notepad++

前端 未结 3 481
我寻月下人不归
我寻月下人不归 2020-12-17 14:05

I have a source file with literally hundreds of occurrences of strings flecha.jpg and flecha1.jpg, but I need to find occurrences of any other

3条回答
  •  天命终不由人
    2020-12-17 15:06

    Notepad++ seems to not have implemented variable-length look-behinds (this happens with some tools). A workaround is to use more than one fixed-length look-behind:

    (?

    As you can check, the matches are the same. But this works with npp.

    Notice I escaped the ., since you are trying to match extensions, what you want is the literal .. The way you had, it was a wildcard - could be any character.

    About the extra question, unfortunately, as we can't have variable-length look-behinds, it is not possible to have optional suffixes (numbers) without having multiple look-behinds.

提交回复
热议问题