develooper Front page | perl.beginners | Postings from March 2002

Re: unusual character splitting

Thread Previous
From:
Jan Gruber
Date:
March 6, 2002 09:00
Subject:
Re: unusual character splitting
Message ID:
200203061659.g26GxVU18602@pollux.intern.primacom.net
Hi Alex && List !

> i want to split a line like:
> $line = 'hello, this is a test line, but what with the letter ä or ë?';
> but i won't get "ë" or "ä",
> thus is my question: which regex do i have to use so i'll get the words
> with diaeresis also in @words?

@words = split(/[\W,.]/, $lijn);

Untested.. split at non-Word or "," or "." .

Maybe this works ;o)

Cheers,
Jan
-- 
cat /dev/world | perl -e "while (<>) {(/(^.*? \?) 42 \!/) && (print $1)}"
errors->(c)
_ 

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About