PHP String Manipulation issues

Source: Internet
Author: User
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]); 
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.