Hi,
lets say I am looking for a number to the left of inch or inches
so if we have
1). 15inch
2). 15.4inch
3). 15 inch
4). 15.4 inch
this:
preg_match('/((\d{1,9})(?:inch|in|inches|Inch|"))/', strtolower($name), $matches_text);
$screen = $matches_text[2];
would return:
1). 15
2). 4 (instead of 15.4)
3). NULL (becuse of the space between 15 and inch)
4). NULL (as above)
the addition of +s reverses the space problem it then does not pic up the ones without a space.
is there a pattern that will cover the decimal,no decimal, space and no space strings?
Thanks all in advance