Link to home
Start Free TrialLog in
Avatar of lrr81765
lrr81765

asked on

Regex help

Ok, new to regex and trying to figure this one out:

sum(one+two+three+four)

I want to get matches for one,two,three,four

Thanks.
Avatar of Tintin
Tintin

You want to capture the matches?

@matches = /(one).(two).(three).(four)/;

Or to make it more generic

@matches = /\((\w+)\+(\w+)\+(\w+)\+(\w+)\)/;

ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial