Re: Little regex tweak help please

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* and then Marek Kilimajer declared....
> >The html *always* looks like this:
> >
> ><form method="post" action="http://example.com/someForm.cgi";  
> >name="user_notification" [some other stuff here]>
> >
> >This is my attempt to find the correct one so far:
> >
> >'/action\s*=\s*"([^"]+)".*name\s*=\s*"([^"]+)"/is'
> >
> >im having trouble putting the 'user_notification' bit in...
> >
> >This does not work:
> >
> >'/action\s*=\s*"([^"]+)".*name\s*=user_notification\s*"([^"]+)"/is'
> 
> You missed the quotes around user_notification, and also possible white 
> chars

Right! - this looks better but still not a winner - small testing
script:


<?php

$formString=<<<EOF
<html>
<head>
<arse>
<form method="post" action="http://actionurl.php"; name="TheWrongForm" />
<form method="post" action="http://theActionUrl.php"; name="user_notification" >
EOF;

preg_match('/action\s*=\s*"([^"]+)".*name\s*=\s*"user_notification"/is', $result, $actionval);

print("<pre>");
print("\$resulti\n\n");
print_r($result);
print("\$actionval\n\n");
print_r($actionval);
print("</pre>");

?>

It produces nothing LoL!
thanks again Marek..

-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux