Best I can come up with is:
/^\w+(\s+\w+?([-'",.!?\s]*
With other punctuation you might see also put in the [ ]
Main Topics
Browse All Topicshi,
i'm a complete dummie with regular expressions, i have a friend that kindly done this one for me /^\w+(\s+\w+?){0,44}$/
i'm matches sentences with a maximum of 45 words, but if i use any punctuation it doesn't work of course.
how can i make it ignore punctuation completely. like even if an isolated punctuation.
thanks in advance...
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Check this:
<form>
<textarea name="myArea" onBlur="alert(this.value.s
hi,
i'm a complete dummie with regular expressions, i have a friend that kindly done this one for me /^\w+(\s+\w+?){0,44}$/
i'm matches sentences with a maximum of 45 words, but if i use any punctuation it doesn't work of course.
how can i make it ignore punctuation completely. like even if an isolated punctuation.
thanks in advance...
</textarea>
</form>
if you want to test the regex without changing your code, here's a nice site which you can test your regex online...
http://www.quanetic.com/re
hope that helps ;^)
ozo,
I'm just curious...
what is the difference other than length, between
/^\S+(\s+\S+?){0,44}$/
and
/^[\w\S]*\w[\w\S]*([\s\W]*
I'm trying to understand what your version would catch and mine wouldn't, just trying to figure out what greater benefit yours offers over what I'd posted for my own educational benefit, not puting yours down or saying you're wrong.... just for knowledge's sake =)
thanks!
kind regards,
~trail
Business Accounts
Answer for Membership
by: trailblazzyr55Posted on 2005-09-02 at 10:01:31ID: 14811837
try this, I'm not able to test but just off the top of my head...
/^\S+(\s+\S+?){0,44}$/
~trail