wpdir icon indicating copy to clipboard operation
wpdir copied to clipboard

Question: How to search for two string in different lines (accepting line breaks between them)

Open Zodiac1978 opened this issue 5 years ago • 4 comments

Hi @PeterBooker - sorry for asking you such a basic question, but I can’t find a working search with line breaks on http://wpdirectory.net

I started with a basic search like this: https://wpdirectory.net/search/01EJEZ66ZANYGE43SCMVJW96EA to find themes with the issue of checking the wrong comment_type (the change of comment_type is explained here: https://make.wordpress.org/core/2020/07/29/miscellaneous-developer-focused-changes-in-wordpress-5-5/).

All hints on stackexchange don’t work for this regex variant ...

I tried many ...

with [/s] https://wpdirectory.net/search/01EJEVTGYD4W4VJFVYQ0RV2JNG https://wpdirectory.net/search/01EJEW571RFRFK7J5WJWGWVJX9 https://wpdirectory.net/search/01EJEXRMBC27VKYZ4VBFZHEMPW https://wpdirectory.net/search/01EJEX5ETGBR21NZY9SQTDF0A6

with (?ms) https://wpdirectory.net/search/01EJEVXJE4ZCTNJD5M7QCVWB6P

with [\r|\n] https://wpdirectory.net/search/01EJEXC1YDDFBWA6E9FDQ9P020 https://wpdirectory.net/search/01EJEXB4HQDH82E823H7374QKQ

https://wpdirectory.net/search/01EJEWER1D6T675A8C7PYJ4XDC

Any help to find the two strings which are in one file but spread on different lines is is much appreciated!

Zodiac1978 avatar Nov 09 '20 18:11 Zodiac1978

@Zodiac1978 I believe this syntax can be used to match newline characters:
first_string(?s).+second_string.
And yes, I realize this issue was opened 4 years ago.

anton-vlasenko avatar Dec 17 '24 22:12 anton-vlasenko

Hey @anton-vlasenko appreciate the ping! After 4 years, I still not found a way to search this way ...

Tried your approach: https://wpdirectory.net/search/01JFCEQ52XZ5X7FMVKXJH4TF8W But zero results.

But I think this should have found this part of Antispam Bee: https://github.com/pluginkollektiv/antispam-bee/blob/master/antispam_bee.php#L254-L262

In PHP it works: https://regex101.com/r/u6RYGx/1

Unfortunately this does not seem to work on https://wpdirectory.net

Zodiac1978 avatar Dec 18 '24 08:12 Zodiac1978

Another example from my initial plan to find broken themes: https://wpdirectory.net/search/01JFCFEDWTJJ5JFAM8AM5ZPVJ5

This search should have found the Yoko theme: https://themes.svn.wordpress.org/yoko/1.2.5/functions.php

Zodiac1978 avatar Dec 18 '24 08:12 Zodiac1978

Hey, @Zodiac1978! I'm confused now because I wonder how this query is working https://www.wpdirectory.net/search/01JFAHJT537STY2RME331GR8W8 while other similar queries (example) clearly don't. That's why I thought the synthax above should do the trick. Maybe I'm missing something very obvious.

anton-vlasenko avatar Dec 18 '24 09:12 anton-vlasenko