次のような文字列があります。
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
または他の方法を使用してそれを達成するにはどうすればよいですか?