Regex for Searching <HEAD> Section
aksarben last edited by
I want to use Notepad++ to find soft hyphen characters (ISO 8859: 0xAD, Unicode U+00AD SOFT HYPHEN, HTML: ) in the <head> section of my HTML files. I tried the two regular expressions below, but both return zero hits.
Curiously, the following regex does finds soft hyphens in <figcaption> sections:
I suspect the issue is that the <head> section contains newlines. I tried the search with the “. matches newline” both checked and unchecked. Still got zero hits both ways.
Is there a way to do this kind of search in Notepad++?
Alan Kilborn last edited by
I think the code blocks you used above are hiding your soft-hyphen character, at least visually. I find that if I copy and paste them into Notepad++, the soft-hyphen character reappears.
Anyway, I would try searching for:
I think there have been some recent postings about Unicode characters used explicitly in the Find-what box of the Find dialog not working correctly…?
guy038 last edited by guy038
Simply, use this regex S/R :
Any SINGLE character or STRING
I assume, of course, that there only one section
<head>........</head>section can be, either, in one line or splitted into several ones
Any soft hyphen, found, above the starting tag
Any soft hyphen, between the starting and the ending tag is found, individually
Any soft hyphen, found, under the ending tag
Preferably, when testing on a single file, tick the
wrap aroundoption, which forces to starts the S/R process from the very beginning of the file