Processing math: 100%
dsavz66262 2015-01-05 05:58
浏览 91
已采纳

“正则表达式中太短的多字节代码字符串”是什么意思?

I am creating a sublime text highlighting file. However, I am stuck with an error I don't fully understand. I have the following regex:

\x([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])

When I try to load the file in sublime text, I get the error:

Error in regex: too short multibyte code string in regex \x([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])

I have tried Googling to understand what this error means, the only thing I have come across that is relavent are the following links:

0. github issue of the rubinius project

1. stackoverflow thread

2. reddit thread

Unfortunately, from those links i could only determine that that error likely caused by a character encoding [ from 1 & 2]. I now suspect that "\x" might be the problem as everything else in that regex is fine. How does one escape that character and all others like it, in particular, can a golang script be used to sanitize regexes to get rid of such problems?

  • 写回答

1条回答 默认 最新

  • douyalin2258 2015-01-05 06:02
    关注

    It means that you forgot to escape the \ in \x.
    Therefore, it's trying to parse a Unicode character escape of the form \x1234, and it didn't find enough numbers.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 vscode开发micropython,import模块出现异常
  • ¥20 Excel数据自动录入表单并提交
  • ¥30 silcavo仿真,30分钟,只需要代码
  • ¥15 FastReport 怎么实现打印后马上关闭打印预览窗口
  • ¥15 利用3支股票数据估计其均值和方差的95%置信区间。
  • ¥15 微信小程序运行一项功能时,弹出未知错误弹框,检查代码没有问题
  • ¥15 ATAC测序生成self-pseudo replicates之前是否要进行去线粒体reads
  • ¥15 python模糊字匹配函数问题
  • ¥20 谁刷目标页面的uv记录器上数据,数据只记录跳转的数值
  • ¥30 数据库软件的安装方法
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部