Wildcard? replaceText, offset?

Thierry Douez th.douez at gmail.com
Mon Apr 27 02:57:34 EDT 2020



> Le 27 avr. 2020 à 08:37, J. Landman Gay via use-livecode <use-livecode at lists.runrev.com> a écrit :
> 
> On 4/26/20 1:24 PM, Rick Harrison via use-livecode wrote:
>> In the middle-end part of the string I have “(x)” where x represents some integer.
>> it could be (4) or (10) or (5) etc.
>> I just want to replace the number inside the () with whatever other number I need to.
> 


   local T = "aaaaa(1)bbbb(z)(345)xxx(567Z33)(666)"

   if  sunnYreplace( T, "\((\d+)\)",  "(42)",  Tr ) then   put Tr

   --> aaaaa(42)bbbb(z)(42)xxx(567Z33)(42)



Thanks to check https://sunny-tdz.com/livecode/sunnyrex <https://sunny-tdz.com/livecode/sunnyrex>

Thierry




More information about the use-livecode mailing list