lima1 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I don't find a working regex for a problem that sounds not very difficult: I want to match sentences (everything that is not just a long word) of a minimum length. Leading and trailing spaces should be ignored. My first idea was
but this matches also long words and also the surrounding spaces.m{\A \s* .{50,}? \s* \z}xms
seems to fix my spaces problem, but still matches long words.m{\A \s* \w .{48,}? \w \s* \z}xms
Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: RE question: Sentence with a minimum length
by salva (Canon) on Oct 06, 2008 at 09:02 UTC | |
by moritz (Cardinal) on Oct 06, 2008 at 09:22 UTC | |
by salva (Canon) on Oct 06, 2008 at 11:01 UTC | |
by salva (Canon) on Oct 06, 2008 at 16:41 UTC | |
by lima1 (Curate) on Oct 06, 2008 at 09:08 UTC | |
Re: RE question: Sentence with a minimum length
by moritz (Cardinal) on Oct 06, 2008 at 08:52 UTC | |
by lima1 (Curate) on Oct 06, 2008 at 08:58 UTC |
Back to
Seekers of Perl Wisdom