Solved

Regular Expression that detects WORDS \w with no vowel in it

Posted on 2003-12-02
6
590 Views
Last Modified: 2012-05-04
I can think of some parts needed to detect a word with no vowels in it, but can't figure out the whole thing (it's early!)..

I was thinking something along the lines of,

(\w[^a|e|i|o|u])

But thats not it...
0
Comment
Question by:Tacobell777
  • 4
  • 2
6 Comments
 
LVL 31

Accepted Solution

by:
GwynforWeb earned 50 total points
Comment Utility
/\W[^aeiou]+\W/i
0
 
LVL 17

Author Comment

by:Tacobell777
Comment Utility
You rock!
Thanks

Stupid of me, ofcourse [^a|e|i|o|u] is a class so no OR | needed..

Ok, so your regex says

Non word characters - No aeiou At least once - Non word character

It doesn't make sense to me? It works, but I'd like to understand it too..
0
 
LVL 31

Expert Comment

by:GwynforWeb
Comment Utility
eg

<script>
reg=new RegExp(/\W[^aeiou]+\W/)
alert(" abcd " + "\n" +reg.test(" abcd "))
alert(" wxyz " + "\n" +reg.test(" wxyz "))
</script>
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 31

Expert Comment

by:GwynforWeb
Comment Utility
Thanks GfW
0
 
LVL 31

Expert Comment

by:GwynforWeb
Comment Utility
It says

Non word characters - a sequence of non aeiou's   - Non word character

ie having a vowel between the nonword chars returns false
0
 
LVL 17

Author Comment

by:Tacobell777
Comment Utility
Cheers...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now