phpuser2013
-
Posts
3 -
Joined
-
Last visited
Posts posted by phpuser2013
-
-
what can I do ?
-
Hi,
I would like to have one expression:
//1. expression
$regex = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/'; //verify email
//2. expression
preg_match_all('~<(td)>(?<content>\w+)</\1>~Uis', $gesamteDatei, $result, PREG_SET_ORDER); //get values of the data set, which are
// the 2. expression doesnt match any email adress
I tried it, but I failed and I dont know why... may be you can help me ?
preg_match_all('~<(td)>(?<content>/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/)</\1>~Uis', $gesamteDatei, $result, PREG_SET_ORDER);
Thanks for your help (:
Make of 2 regular expressions 1 regular expression
in Regex Help
Posted · Edited by phpuser2013
Thanks for your help so far,
I got a file where i want
...<tr><td>value 1</td><td>value 1</td><td>value 2</td><td>value 3</td><td>value 4</td><td>value 5</td><td>value 6</td><td>email</td><td>value 8</td></tr> ... //1 dataset
The problem is that the value is mostly at a different position:
like ->
...<tr><td>value 1</td><td>value 1</td><td>value 2</td><td>value 3</td><td>value 4</td><td>email</td><td>value 6</td><td>value 7</td><td>value 8</td></tr> ... //1 dataset
or like ->
...<tr><td>value 1</td><td>value 1</td><td>value 2</td><td>value 3</td><td>value 4</td><td>value 5</td><td>value 6</td><td>value 7</td><td>email</td></tr> ... //1 dataset
and I need some of the value left or right of that field,
I tried to solve it like this:
preg_match_all('/<td>(.*?)<\/td>/',$gesamteDatei,$InhaltTdElemente); //find values
$gesamteDatei= whole stream(1 table and many datasets)
$InhaltTdElemente= all values between <td> </td>
I need to search for something"(ZiP, Country....)
preg_match_all('~<(td)>(?<content>\w+)</\1>~Uis', $gesamteDatei, $result, PREG_SET_ORDER);
// that doesnt give me the email address