I sort some lines and some contain email, some not.
I need to delete all lines less than 6 characters.
I surfed a bit and did not find any solid answers, so I tried to write my first expression.
Please tell me if this works. Did I understand correctly?
$six-or-more = preg_replace("!\b\w{1,5}\b!", "", $line-in);
The following are the ones that I “stole” that may actually be redundant.
$no-empty-lines = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $six-or-more);
$lines = preg_split("/[\s]*[\n][\s]*/", $no-empty-lines);
You can see what I'm trying to do, but I think this is not much.
Thanks for the tutorial.
source
share