I'm looking for a regex to get from this:
<%image(20100213-na-de-les-mag-hij-even-blijven.jpg|120|120|)%>
to this:
20100213-na-de-les-mag-hij-even-blijven.jpg
Should be really simple but I'm kinda new to regex and been trying for over an hour now. I think the < and % and | are things that regex uses and I have to escape them?
Thank you!
definely this one shall match :
\(([^\|]+)\|
with delimiters :
/\(([^\|]+)\|/
Try something like this:
<%image\((.*)\|.*\|.*\|\)%>
You have to escape the characters |
, (
and )
, you will be able to capture the stuff inside the parentheses (.*)
. (Greedy)
http://regex101.com/r/eY6kM2/1
Or for a more lazy approach:
<%image\(([^\|]*?)\|.*\|.*\|\)%>