Skip to main content

Thread: php regex help


i trying parse webpage , read few tags. example, have many <form> tags in page , want specific tag having specific id, "loginform"
html code:
<form id="loginform" style="margin:0px;" action="targetpage.php" method="post">
i want read part.

created pattern preg_match:
php code:
$pattern '/\<form[.\s]*(id="loginform")+[^\>]*\>/i'
well, when test works fine, if there multiple forms, selects 1 having "loginform" id.

when try on actual page, fails. may reason is, actual page may contain newline characters, not sure, can tell me how overcome problem?

in advance.

quote posted zobayer1 view post
but when try on actual page, fails. may reason is, actual page may contain newline characters, not sure, can tell me how overcome problem?
use m modifier eg. in case add '/im' end of regex.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] php regex help


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support