<?php
/* Finding Floats in an Array */
$arr = [
// Short String
'123',
// Long String
'123 and another float at the end 123.23',
// Mixed String
'4.7 + 99 / 8...8 00.b',
// Float
123.444,
// Decimal
444,
];
$pattern = '%(\d+)?\.\d+%';
var_dump(preg_grep($pattern, $arr));
/* Find occurrences of either a space at the start of the string or a "ing" word */
$arr2 = [
"Examine she brother prudent add day ham.\n
Far stairs now coming bed oppose hunted become his. You zealously departure had procuring suspicion. Books whose front would purse if be do\n decay. Quitting you way formerly disposed perceive ladyship are. Common turned boy direct and yet.",
"Behind sooner dining so window excuse he summer. \n Breakfast met certainty and fulfilled propriety led. Waited get either are wooded little her. Contrasted unreserved as mr particular\n collecting it everything as indulgence. Seems ask meant merry could put. Age old begin had boy noisy table front whole given.",
"Enjoying minutes related as at on on. Is dried as often me. Goodness as reserved raptures to mistaken steepest oh screened he. Gravity he mr sixteen esteems. Mile home its new way with high told said. Finished no horrible blessing landlord\n dwelling dissuade if. Rent fond am he in on read. Anxious cordial demands settled entered in do to colonel.",
" <p>Remaining lively hardly needed at do by. Two you fat downs three.\n True mr gone most at. Dare as name just when with it body. Travelling inquietude she increasing off impossible the. Cottage be noisier looking to we promise on. Disposal to kindness appetite diverted learning of on raptures.<br> Betrayed any may returned now dashwood formerly. Balls way delay shy man views. No so instrument discretion unsatiable to in.</p>",
];
$pattern = '%^(\s+)|^(\w+)(ing)%';
var_dump(preg_grep($pattern, $arr2));
/* Invert results with Flag */
var_dump(preg_grep($pattern, $arr2, PREG_GREP_INVERT));