CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   PHP (http://www.codingforums.com/forumdisplay.php?f=6)
-   -   Resolved preg_match_all 2 cases (http://www.codingforums.com/showthread.php?t=288111)

kenshn111 02-22-2013 09:28 AM

preg_match_all 2 cases
 
Heyyy

I was trying to get the text between the '.' and ']' and also the text between the two ":

PHP Code:

$html '[ACCESSORY_IDs.ACCESSORY_GOGGLES] = "_°í±Û"';

preg_match_all('/(s.)(.*?)]/'$html$matchesPREG_SET_ORDER);

foreach (
$matches as $val) {
    echo 
"matched: " $val[0] . "<br>";
    echo 
"part 1: " $val[1] ."<br>";
    echo 
"part 2: " $val[2] ."<br>";
    echo 
"part 3: " $val[3] ."<br>";
    echo 
"part 4: " $val[4] ."<br><br>";


the code outputs
Quote:

matched: s.ACCESSORY_GOGGLES]
part 1: s.
part 2: ACCESSORY_GOGGLES
along with multiple errors but the errors are expected

I tried to look for a tutorial about the patterns but I haven't found any, I guess I was too dumb to find one. :x

can someone help me or teach me please?

Arcticwarrio 02-22-2013 10:09 AM

Try

http://txt2re.com/

is good for that kind of stuff


All times are GMT +1. The time now is 06:40 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.