Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a regular expression

Status
Not open for further replies.

jeepxo

Programmer
Oct 1, 2002
228
CA
At some point I should really learn how to use these because they are really handy.

I want to add a spell checker to a web application, and have a great little one that will check individual words. Of course only Bill Shatner. Speaks. In. One. Word. Sentences. so I am looking for a regular expression that will give me each word in a sentence.

I'm thinking I need something that looks for a space then some text then a space.

Any suggestions on what the Regex looks like would be greatly appreciated.

"Every day is like a precious gift, you have to make it count" James Birrell 1993-2001
 
Maybe you could take your string and use the Split() function with space as a delimitter to create an array of words... then iterate through the array checking each word?
 
look for word boundary (/b) feature of Regular Expressions...

I would just use the array and split the string at a white space to separate the individual words in a sentence...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top