|
Re: Regular Expression Question: msg#00133lang.smalltalk.squeak.beginners
pbohuch wrote:
If I execute this in a workspace, I get an infinite loop. I think it's a problem with the expression - don't ^\s* and \w+ look for the same thing? Anyway, wouldn't '\w+|\s+' do what you want? 'this is a test' allRegexMatches: '\w+|\s+' "=> ('this' ' ' 'is' ' ' 'a' ' ' 'test')" Or if you just want the words, '\w+'. And, if you just want the words then you can probably just use #findTokens: 'this is a test' findTokens: ' ' "=> ('this' 'is' 'a' 'test')" Regards, Zulq.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: Programatically keep image up to date, itsme213 |
|---|---|
| Next by Date: | phone calls made ..., Dave Raymer |
| Previous by Thread: | Regular Expression Question, pbohuch |
| Next by Thread: | Re: One click setup for 3.9 [win], valente |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |