问题标签 [oniguruma]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
php - 查找带有特殊字符的子字符串
我有模式'šalotka 29%'
,我需要知道字符串是否'something something šalotka 29% something'
包含模式,但不知道模式是否是较长单词的一部分'something something šalotka 29%something'
我有这个mb_eregi('\b' . $pattern . '\b', $string)
,但它不起作用,因为正则表达式边界不适用于特殊字符。有什么建议吗?