my preg_replace replaces my whole string instead of just the bit where the expression fits.
Code:
http://beta.yapaste.com/bd
This is what I want replaced:
<table id=\"post24100391\" style=\"width: 100%;\" class=\"p4\" >
Thanks for help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
yes….. that regex matches the entire table…. it will replace the entire string with $replace.
what is it you want to replace?
You could use capturing replacement…
Or you could use a non-capturing group around the parts to not replace…
e.g.
EDIT in response to OP change
You wanted to use lazy capturing *?