From: Siddarth Chandrasekaran on
I looked through the archives, but couldn't find a comprehensive
tutorial on regular expressions -- could someone please point me to
one?

Specifically, I'm looking to extract all the words from a string that
are capitalized, but can't find case-based match operators.

Thanks,

Siddarth

From: Ehsanul Hoque on

To test regular expressions (and with a handy little regex reference at the bottom), use rubular: http://rubular.com/
And for your particular issue, try this:
str = "this Is Some test String eh?" cap_words = str.scan(/[A-Z]\w+/)

- Ehsan
> Date: Thu, 17 Jun 2010 13:34:36 +0900
> From: chandrasekaran.siddarth(a)gmail.com
> Subject: RegEx Tutorial?
> To: ruby-talk(a)ruby-lang.org
>
> I looked through the archives, but couldn't find a comprehensive
> tutorial on regular expressions -- could someone please point me to
> one?
>
> Specifically, I'm looking to extract all the words from a string that
> are capitalized, but can't find case-based match operators.
>
> Thanks,
>
> Siddarth
>

_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
From: Siddarth Chandrasekaran on
Got it, thanks!

Siddarth



On Wed, Jun 16, 2010 at 9:34 PM, Siddarth Chandrasekaran
<chandrasekaran.siddarth(a)gmail.com> wrote:
> I looked through the archives, but couldn't find a comprehensive
> tutorial on regular expressions -- could someone please point me to
> one?
>
> Specifically, I'm looking to extract all the words from a string that
> are capitalized, but can't find case-based match operators.
>
> Thanks,
>
> Siddarth
>
>

From: Josh Cheek on
[Note: parts of this message were removed to make it a legal post.]

On Thu, Jun 17, 2010 at 12:42 AM, Siddarth Chandrasekaran <
chandrasekaran.siddarth(a)gmail.com> wrote:

> Got it, thanks!
>
> Siddarth
>
>
>
> On Wed, Jun 16, 2010 at 9:34 PM, Siddarth Chandrasekaran
> <chandrasekaran.siddarth(a)gmail.com> wrote:
> > I looked through the archives, but couldn't find a comprehensive
> > tutorial on regular expressions -- could someone please point me to
> > one?
> >
> > Specifically, I'm looking to extract all the words from a string that
> > are capitalized, but can't find case-based match operators.
> >
> > Thanks,
> >
> > Siddarth
> >
> >
>
>
Sounds like you are using the proposed regex. Why don't you go to the given
site (rubular), put in "javaVariable", and see if it gives you what you
expect.

If not, here is a decent explanation of the different things you could do to
match. http://www.zenspider.com/Languages/Ruby/QuickRef.html#11

From: Siddarth Chandrasekaran on
> Sounds like you are using the proposed regex. Why don't you go to the given
> site (rubular), put in "javaVariable", and see if it gives you what you
> expect.

Nope, I edited the regex to account for spaces.

> If not, here is a decent explanation of the different things you could do to
> match. http://www.zenspider.com/Languages/Ruby/QuickRef.html#11

Great, thanks!

Siddarth



On Wed, Jun 16, 2010 at 11:02 PM, Josh Cheek <josh.cheek(a)gmail.com> wrote:
> On Thu, Jun 17, 2010 at 12:42 AM, Siddarth Chandrasekaran <
> chandrasekaran.siddarth(a)gmail.com> wrote:
>
>> Got it, thanks!
>>
>> Siddarth
>>
>>
>>
>> On Wed, Jun 16, 2010 at 9:34 PM, Siddarth Chandrasekaran
>> <chandrasekaran.siddarth(a)gmail.com> wrote:
>> > I looked through the archives, but couldn't find a comprehensive
>> > tutorial on regular expressions -- could someone please point me to
>> > one?
>> >
>> > Specifically, I'm looking to extract all the words from a string that
>> > are capitalized, but can't find case-based match operators.
>> >
>> > Thanks,
>> >
>> > Siddarth
>> >
>> >
>>
>>
> Sounds like you are using the proposed regex.  Why don't you go to the given
> site (rubular), put in "javaVariable", and see if it gives you what you
> expect.
>
> If not, here is a decent explanation of the different things you could do to
> match. http://www.zenspider.com/Languages/Ruby/QuickRef.html#11
>