Hello

I am very week with regular expressions. It may be too easy for someone.

I have following regular expression

loc_content_re = /(?:([A-Za-z\s:]*?):)?([\s\S]*)/
> content = "HYDERABAD/NEW DELHI: Andhra Pradesh chief minister was ...."
>


I wanted to extract "HYDERABAD/NEW DELHI" from above content

match_re = loc_content_re.match(content)
> location = $1
> plain_content = $2
>


It shows location nil and plain_content as passed


One more,

What will be the regular expression to extract
IANS and
3 September 2009, 02:57pm IST
from following
" IANS 3 September 2009, 02:57pm IST "

Thanks !
Sandip

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to