clean http file
-
hi everybody, i’ve saved an html file and i make a new macro to clean this file and keep only https links
this is the file after some step of my macro:
(note: i have 6 space at beginning, before </div> tag)</div></td><td><a href="https://g918-0f6cd9050b3b/IMG_20200906.jpg" target="_blank" class="text-fs-6">IMG_20200906.jpg</a> </div></td><td><a href="https://s06.00f6-4b63-9901-a698c6718296/haras0004.jpg" target="_blank" class="text-fs-6">haras0004.jpg</a> </div></td><td><a href="https://s784e473fc-c0d0-4a19-8c62/carama.jpg" target="_blank" class="text-fs-6">carama.jpg</a> </div></td><td><a href="https://s86.ce02-45c8-8518-38eae69d7832/IMG_202007.jpg" target="_blank" class="text-fs-6">IMG_202007.jpg</a>i need to have this only:
https://g918-0f6cd9050b3b/IMG_20200906.jpg https://s06.00f6-4b63-9901-a698c6718296/haras0004.jpg https://s784e473fc-c0d0-4a19-8c62/carama.jpg https://s86.ce02-45c8-8518-38eae69d7832/IMG_202007.jpgnow my macro use this regex to clean first part:
replace (?-s).*href="and this regex to clean final part:
replace (regex) ".*but i have a better way to do this?
maybe with only one command?
Regards -
Hi, @pinuzzu99 and All,
Easy ! just use, in your macro the following search/replace regexes, below :
SEARCH
(?-s)^.+?"(.+?)".+REPLACE
$1OR\1
Note that I used lazy quantifiers (
+?) in order to get the smallest range of characters before the first"char and before the last one, as well !Best Regards,
guy038
-
wow. your code work like a charm!
for me found right code like your is a big effort.
thank you so much for your support!Regards
-
still another question: how to bookmark all lines between https: and .jpg ?
https://xxxxxxxxxxxxxxxx.jpg -
Hello, @pinuzzu99 and All,
I’m surprised that you have not found the solution by yourself !
- If you want to bookmark the lines of your INPUT file, use the regex
https.*?\.jpg
BTW, this is a second solution to your initial problem : once that all the sections are marked with the
Mark Allbutton, simply use theCopy Marked Textbutton and paste the results in a new tab !- And, if you want to boomark the lines of your OUTPUT file, use the obvious regex
(?-s)^.+
BR
guy038
- If you want to bookmark the lines of your INPUT file, use the regex
-
thank you (again) for your reply.
great and hopeful answerand sorry for this useless stuff, but how code use to put all your regex? from Replying toolbar i can see only “code” tag …
-
Hi, @pinuzzu99 and All,
When you click on a
replylink, to elaborate an answer, simply click on the linkCOMPOSE ?, in order to get a summary of the mainMarkdownsyntaxes !You may also look to the valuable
Markdowntutorial !Note that my regex’s syntax is an
In line code, which is displayed inredcolor on our site. You may emphasize this code with the italic or bold syntaxes , as I usually do !Best Regards,
guy038
-
and so
thanksfor your for your explanation !All the best