开发者

regex to replace all from value - php

Hello I need to pull out the value of the input that has the name ending in "message" and replace the whole thing with the match. It needs to be a replace. any ideas what the regex is for this?

Thank you for the help.. Cheers -Jeremy

I have tried alot and this is the last one

patteren /.*?(message" value="(.*?)").*?/is

replacement $2

wanting

The value specified for "Email" is already in use by another registered user

in

    <input type="hidden" name="cntnt01message" value="The value specified for &amp;quot;Email&amp;quot; is already in use by another registered user" />

for this content

    <form id="cntnt01moduleform_1" method="post" action="http://www..com/account/registration.html" class="cms_form">
    <div class="hidden">
    <input type="hidden" name="mact" value="SelfRegistration,cntnt01,default,0" />
    <input type="hidden" name="cntnt01returnid" value="60" />
    <input type="hidden" name="cntnt01assign" value="CONT" />
    <input type="hidden" name="cntnt01returnid" value="60" />
    <input type="hidden" name="cntnt01input_username" value="s" />

    <input type="hidden" name="cntnt01input_Salon" value="s" />
    <input type="hidden" name="cntnt01input_Hairstylist" value="s" />
    <input type="hidden" name="cntnt01input_email" value="s@cableone.net" />
    <input type="hidden" name="cntnt01input_email_again" value="s@cableone.net" />
    <input type="hidden" name="cntnt01input_Firstname" value="s" />
    <input type="hidden" name="cntnt01input_Lastname" value="Bass" />
    <input type="hidden" name="cntnt01input_phone" value="208-s-s" />
    <input type="hidden" name="cntnt01input_Street" value="s21st ave" />
    <input type="hidden" name="cntnt01input_city" value="s" />
    <input type="hidden" name="cntnt01input_state" value="Idaho" />
    <input type="hidden" name="cntnt01input_zip" value="s" />
    <input type="hidden" name="cntnt01input_Description" value="" />
    <input type="hidden" name="cntnt01input_services" value="Color,Perm/Relaxer,Sisterlocks®,Braiding" />
    <input type="hidden" name="cntnt01orig_url" value="http://www..com/account/registration.html?mact=SelfRegistration,cntnt01,default,0&amp;amp;cntnt01returnid=60&amp;amp;cntnt01group=Platinum&amp;amp;cntnt01pkg=4" />
    <input type="hidden" name="cntnt01group_id" value="4" />
    <input type="hidden" name="cntnt01pkg" value="4" />
    <input type="hidden" name="cntnt01submit
    " value="" />

    <input type="hidden" name="cntnt01error" value="1" />
    <input type="hidden" name="cntnt01message" value="The value specified for &amp;quot;Email&amp;q开发者_StackOverflow社区uot; is already in use by another registered user" />
    </div>


You're looking for .? (0 or 1 of any character except a new line). I think you should look for [^"]+ i.e.: /message" value="([^"]+)"/is and replace with $1 (not sure why the other brackets are there unless that's for something else).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜