如图,“第?{1,7}条”这部分不是说“第”字与“条”字之间最多七个字符吗?那为什么图中被选中的部分字数那么多呢?
哇,M$ Word 的正则表达式,比 neovim 还难用。
建议楼主先把这篇英文教程仔细看一遍:
具体到本楼问题:
The question mark ? is used to find individual characters. If used with curly brackets to define a range of characters eg #?{1,3}# it will behave as an asterisk and find all the characters between the hash symbols.
1 Like
用「.」替换「?」呢
那样查不到东西
但是里面没有说怎么解决这个问题
1 Like
要学会变通啊,小伙计,不能用 ?{1,7},就用 [!【】]{1,7} 呗。我没有在 Word 用正则表达式的需求,所以只瞄了一眼上面那个教程。你有需求,应该仔细读一遍。
Word 只能称之为通配符,Vim 的正则强大得多。