我有一个像这样的字符串:
str = 'in europe it costs 250 eur'
或者:
str = 'in europe it costs a lot (250eu)'
或者:
str = 'eureka! I found it and it costs eu250'
或者:
str = 'eureka! I found it and it costs 250.00eur'
等等..
当它们后面和前面有一个非字符 ( ) 时,我想替换两者'eu'
,但我不希望它们成为替换的受害者。我如何使用或其他方法完成该任务?'eur'
'euro'
[^a-z]
sub