Comparing a string word by word

I am facing a problem where we have to compare two strings. I applied
the regex to match it and it works fine for the string which dont have
space in between. However in case, the matching string containg space,
then its failing.

Please let me know how to tackle this.

Thanks in advance.

···

--
Posted via http://www.ruby-forum.com/.

Could you send your string and regexp?

Abinoam Jr.

···

On Mon, Jan 17, 2011 at 5:14 AM, Brajmohan S. <braj1999@gmail.com> wrote:

I am facing a problem where we have to compare two strings. I applied
the regex to match it and it works fine for the string which dont have
space in between. However in case, the matching string containg space,
then its failing.

Please let me know how to tackle this.

Thanks in advance.

--
Posted via http://www.ruby-forum.com/\.

You could either extract words and compare corresponding arrays or you
build your regexp to account for different whitespace sequences. What
exactly are you attempting?

Cheers

robert

···

On Mon, Jan 17, 2011 at 9:14 AM, Brajmohan S. <braj1999@gmail.com> wrote:

I am facing a problem where we have to compare two strings. I applied
the regex to match it and it works fine for the string which dont have
space in between. However in case, the matching string containg space,
then its failing.

Please let me know how to tackle this.

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/