• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 601
  • Last Modified:

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

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
Tacobell777
Asked:
Tacobell777
  • 4
  • 2
1 Solution
 
GwynforWebCommented:
/\W[^aeiou]+\W/i
0
 
Tacobell777Author Commented:
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
 
GwynforWebCommented:
eg

<script>
reg=new RegExp(/\W[^aeiou]+\W/)
alert(" abcd " + "\n" +reg.test(" abcd "))
alert(" wxyz " + "\n" +reg.test(" wxyz "))
</script>
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
GwynforWebCommented:
Thanks GfW
0
 
GwynforWebCommented:
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
 
Tacobell777Author Commented:
Cheers...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now