
Do you already have a solution for this? I am trying to improve my regex-skills. My solution would be: replace every \s by a  . Maybe not good enough... Or replace every \s\s by \s , loop over it until there are no more \s\s, and then replace every \s  by   . Ward Michiel Van Bel wrote:
K, my brain hurts a bit... I have a plain-file(blast-output) that's already been formatted.
Of course, when I just read it in php and send it to html, the layout is totally gone (newlines, spaces, tabs, ...). Anyone has an idea how to easily fix it?
$data = str_replace("\n","<br/>",$data); //fixes newlines
I'd say that replacing every multiple (2+) occurrence of a space should be replaced by the same multiple of (   ), but I can't figure it out exactly (brain is still hurting):
$data = preg_replace("/(\s)(\s+)", ... ,$data); // -->how do you get the count of \s+ ???, so i can replace it by the same count of  's ?
anyone?
-- ================================================================== Ward Blondé wablo@psb.ugent.be PhD student Tel:+32 (0)9 331 38 24 fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, Ghent University Technologiepark 927, 9052 Gent, BELGIUM http://www.psb.ugent.be/cbd/people_ward_blonde.php ==================================================================