Using the correct selector just might help !! :-)
====================================================
*** hiddennumbers.ws 10:24:43
098m03r9f80239802389f0m9KDKLKLJDKLJm0983m890DMOm03
dlkfj3hljf4h3klhl00000002998
098 03 9 80239802389 0 9 0983 890 03 3 4 3 00000002998
========================= and the code now is =========
| txt nums |
Transcript cr; show: '*** hiddennumbers.ws '; show: Time now printString ;
cr.
txt := '098m03r9f80239802389f0m9KDKLKLJDKLJm0983m890DMOm03
dlkfj3hljf4h3klhl00000002998'.
Transcript cr; show: txt ; cr.
txt := txt replacingAllRegex: '\D+' with: ' '. " gst
code "
" replace all alphas with space "
Transcript cr; show: txt ; cr.
==================================================
Paolo Bonzini-2 wrote:
>
> dragoncity wrote:
>> The following VWST code works fine, however in trying to convert to gst I
>> cannot find much help
>> in changing the REGEX line of code.
>>
>> The problem is to extract all the integers from a text line and sort into
>> order and print, and NO its not a class test :-),
>> just a example of string manipulation from a C++ site I think.
>>
>> I've tried replaceAllRegex:with: and am getting a doesNotUndertstand
>> error
>
> #replacingAllRegex:with: is the name of the selector.
>
> You can also use #allOccurrencesOfRegex:.
>
> Paolo
>
>
> _______________________________________________
> help-smalltalk mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk
>
>
--
View this message in context:
http://www.nabble.com/problem-with-regex-usage-tp19709076p19716958.html
Sent from the Gnu - Smalltalk mailing list archive at Nabble.com.
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk