String: {user:link islocal= ' 1 '}/2013/userup/100/131a2z34-5n8.doc {/user:link}
How to remove 131a2z34-5n8 string???
For example, there are many similar strings:
String 1:{user:link islocal= ' 1 '}/2013/userup/100/131a2z34-800.doc {/user:link}
String 2:{user:link islocal= ' 1 '}/2013/userup/100/131a2z34-801.doc {/user:link}
String 3:{user:link islocal= ' 1 '}/2013/userup/100/131a2z34-802.doc {/user:link}
Remove the string separately:
131a2z34-800
131a2z34-801
131a2z34-802
Do you want to use regular, how to do it?
Reply to discussion (solution)
$s =<<
This is the case:
{user:link islocal= ' 1 '}/I am random string/I am random string/I am random string/I am random string {/use R:link}
only "{/user:link}" is the same, not necessarily doc, maybe. xls. txt but there must be.
I think I can only do it from/131a2z34-802.doc {/user:link}, but I can't think of it
preg_match_all (' #/([^/]+?)
\.# ', $s, $m);p rint_r ($m [1]);