9 lines
332 B
Text
9 lines
332 B
Text
set text to "This is a story about R2D2 and C3P0 who are best friends."
|
|
set pattern to <word start, letter, digit, letter, digit, word end>
|
|
|
|
put the sixth word of text matches pattern -- (note: the sixth word is "R2D2")
|
|
|
|
put every occurrence of pattern in text
|
|
|
|
replace the second occurrence of pattern in text with "Luke"
|
|
put text
|