How to emulate word boundary when using unicode character properties?

前端 未结 2 1204
后悔当初
后悔当初 2020-12-19 03:54

From my previous questions Why under locale-pragma word characters do not match? and How to change nested quotes I learnt that when dealing with UTF-8 data you can\'t trust

2条回答
  •  感情败类
    2020-12-19 04:03

    You should be using negative lookarounds:

    (?

    The positive lookarounds fail at the start or end of the string because they require a non-word character to be present. The negative lookarounds work in both cases.

提交回复
热议问题