Reputation: 703
I want to write a regular expression to search out all "http" string and replace it with "https", I use following Reg expression:
\bhttp\b
but some results are not what I want, for example:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
so how can I exclude this? I want to use notepad++ to do this.
Upvotes: 1
Views: 96
Reputation: 6200
Ultimately if the data is not structured, and you have to string filter, then you need to assess the whole dataset, and decide if this is to be done as a once-off, or if you need a system to do frequently perform the same type of operation, on similar documents, or very different documents, etc..
If it is only the meta line example you want to exclude:
\bhttp[^-]\b
If all relevant instances of http
are in a certain format, i.e. href="http
:
\b(?<=href=")http\b
The latter example will match using href="
but not include it in the replace operation
Upvotes: 1