Re: newbie question: Regular expression lookbehind?



cjl wrote:

new RegExp("^\\s*class\\s([A-Za-z]+)", 'gm')

How do I ignore 'class' without a lookbehind?. I think my regular
expression is returning two groups:
0: class monkey
1: monkey

I only want it to return the second group.

Can anyone point me in the right direction?

Use that expression, call the exec method and access the second item in the returned array.


--

Martin Honnen
http://JavaScript.FAQTs.com/
.