Question

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?

Was it helpful?

Solution

Try this one. The first capturing group should contain the result:

<img\s+src\s*=\s*"[^"]*\/([^"]*)\.[^"]*"[^\/]*\/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top