i have some regexp (like ^\w+[\w-.]\@\w+((-\w+)|(\w)).[a-z]{2,3}$, to match correct emails), but i cant figure out how to remove everything that doesn't match the regexp in my string.
Keeping the email example, i need a way to, given a sting like
$myString = "This is some text, the email is here [email protected], and other things over here";
i need to return just '[email protected]', or boolean false, if there is no email in the strings.
Of course, the email is just an example, some others times I'll need to remove everything except integer/floating numbers, etc...
I've googled around so much but didn't find anything.