Blog
Developers
Careers
Support
Contact
Gossamer Threads
Solutions
Results
About
Mailing Lists
Resource Centre
Forum
Tools
Home
Who's Online
Tags
Favourites
Login
Forum Search
(
Advanced Search
)
This forum
This category
All forums
for
Home
:
General
:
Perl Programming
:
at least 3 words
Previous Thread
Next Thread
Print Thread
View Threaded
May 8, 1999, 6:00 AM
TecLine
Novice
(21 posts)
May 8, 1999, 6:00 AM
Post #1 of 3
Views: 2995
Shortcut
at least 3 words
Is this the reg. exp. for at least 3 words?
Code:
'.\s{3,}'
May 9, 1999, 4:39 AM
ds
User
(165 posts)
May 9, 1999, 4:39 AM
Post #2 of 3
Views: 2835
Shortcut
Re: at least 3 words
In reply to
Im not sure, but i thought: '[\s]{3,}'
May 10, 1999, 4:37 PM
Alex
Administrator
(9387 posts)
May 10, 1999, 4:37 PM
Post #3 of 3
Views: 2827
Shortcut
Re: at least 3 words
In reply to
Well, not really. What that matches is any character followed by a space three or more times. Since a space is any character, it counts those as well.
Try:
m/(\b\w+\b){3,}/
which I think should do the trick. It says match a word boundry, followed by one or more letters/numbers, followed by another word boundary.
Hope that helps,
Alex
Previous Thread
Next Thread
Print Thread
View Threaded