Extract file name from html string using regex in Idoc Script
-
26-06-2021 - |
Domanda
I need to extract file name of an image from one html string using Idoc Script regex functions.
Input string:
"<img src="/cs/content./file_name.png" alt="" />"
Output need to be:
"file_name"
Can you help me?
Soluzione
Try this one. The first capturing group should contain the result:
<img\s+src\s*=\s*"[^"]*\/([^"]*)\.[^"]*"[^\/]*\/>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow