Tricky regex question
Hi,
I need to split words from a sentence that are more than 2 letters. An example sentence is:
This is "very" 'tricky'. I won't be able see it.
I came up with the following regex, but it breaks the word won't and I only get the part that is before the single quote.
[&]*\b[a-zA-Z]{2,}+\b
My objective is to extract the following words.
This, very, tricky, won't, able
Thanks.
[434 byte] By [
imranha] at [2007-11-26 16:51:56]

# 1
If you're looking for a word which may contain up to one apostrophe you'd want \b[a-zA-Z]+('[a-zA-Z]+)?\bI'm not sure what your [&]* is about, or what your precise specification is for counting letters in words with apostrophes, so I'll leave it to you to put the pieces together.
# 3
> Thank you. That does the trick.
>
> The & sign is to remove any words starting with &.
> Similar to & in an HTML document.
>
> Best regards.
That doesn't remove them it allows for any number of ampersands in the beggining of the word.