7 lines
164 B
Smalltalk
7 lines
164 B
Smalltalk
|re s s1|
|
|
re := 'm[a-z]+ing' asRegex.
|
|
s := 'this is a matching string'.
|
|
|
|
(re search: s) ifTrue: [ 'matches!' ].
|
|
|
|
s1 := re copy: s replacingMatchesWith: 'modified'.
|