仅在所有字符匹配时替换字符串(泰语)
问题是มาก从技术上讲是在มาก็中。因为มาก็是มาก +็。
因此,当我这样做时
"แชมพูมาก็เยอะ".replace("มาก", " X ")
,我最终会得到
แชมพู X ็เยอะ
我想要的
แชมพู X เยอะ
真正想要的是强迫最后一个角色client tum算作一个字符,因此不再匹配มาก็。
The problem is that มาก technically is in มาก็. Because มาก็ is มาก + ็.
So when I do
"แชมพูมาก็เยอะ".replace("มาก", " X ")
I end up with
แชมพู X ็เยอะ
And what I want
แชมพู X เยอะ
What I really want is to force the last character ก็ to count as a single character, so that มาก no longer matches มาก็.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然我没有找到适当的解决方案,但我能够找到 a 解决方案。我将每个字符串分为单独的(组合)字符。然后,我将这些列表彼此比较。
正则表达式会像这样拆分:
并且随着比较ก็ก็函数函数数字不相同。
我会标记为回答,但是如果有一个不错的或“适当”的解决方案,我会选择那个解决方案。
While I haven't found a proper solution, I was able to find a solution. I split each string into separate (combined) characters via regex. Then I compare those lists to each other.
The regex will split like this:
And as it compares ก็ to ก the function figures the words are not the same.
I will mark as answered but if there is a nice or "proper" solution I will chose that one.