could not find where is it going wrong
Posted: Wed Jan 31, 2007 10:05 am
i have blocks like this in a file which have to be extracted.
i want to take in blocks of ( LIN .... ALC..' )
my code is
can anyone see what is wrong in there?
Code: Select all
LIN+1+3+9780194346092:EN++2'
QTY+52:100'
DTM+44:19971009:102'
FTX+LIN++IP:8B:28'
TAX+7+VAT+++:::17.5+S'
MOA+125:21.6'
PRI+AAE:25.38::SRP'
ALC+A+EQ'
LIN+2+3+9780192717931:EN++2'
QTY+52:0'
DTM+44:19980521:102'
FTX+LIN++OP:8B:28'
TAX+7+VAT++++Z'
PRI+AAE:12.99::SRP'
ALC+A+CK'my code is
Code: Select all
$regex = '#\bLIN.*?ALC.*?\'#mi';
preg_match_all( $regex, $fileContents, $blocks );
print_r( $blocks );