Hi,
1. /\w+[^\w\s]/
2. /\w+[\p{P}]/
Try rubular.com for any regex problem



On Mon, Jan 27, 2014 at 5:47 PM, Selvag Ruby <lists / ruby-forum.com> wrote:

> Ruby Regular Expression
>
> 1.How to extract the words which are exist with symbols like
> punctuation.
>  For eg:
>
> str='Now, I am Ruby programmer. here, how to list the word which is
> exist                with symbol like punctuation, comma, or
> exclamation.'
>
> that Output may be as:
> =>['Now,','programmer.','here,','punctuation,','comma,','exclamation.']
>
> 2.from that result, remove the symbol from word and in array. this
> result may be as:
> =>['Now','programmer','here','punctuation','comma','exclamation']
>
> --
> Posted via http://www.ruby-forum.com/.
>



-- 
--------------------------------
Thanks & Regards
Asif Iquebal Sarkar
Bhubaneswar, Orissa