首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >谁有把RegExp翻译成“自然语言”的算法?

谁有把RegExp翻译成“自然语言”的算法?
EN

Stack Overflow用户
提问于 2012-01-23 16:11:15
回答 2查看 1.2K关注 0票数 5

我想把正则表达式“翻译”成人类可读的解释。

例如:/^[a-z0-9_]{6,18}/将被翻译成类似于:

A string start with 6 to 18 char(s) in a range of a to z, 0 to 9 and _.

EN

回答 2

Stack Overflow用户

发布于 2012-01-23 16:14:34

Expresso,一个免费的工具,可以做到这一点(并且做得很好)。

Expresso 3.0 on Microsoft's regular expression Webcast series

票数 3
EN

Stack Overflow用户

发布于 2012-01-23 16:31:39

使用RegexBuddy (但在我看来,这是最好的工具),表达式的文档记录如下:

代码语言:javascript
复制
// ^[a-z0-9_]{6,18}
// 
// Options: ^ and $ match at line breaks
// 
// Assert position at the beginning of a line (at beginning of the string or after a line break character) «^»
// Match a single character present in the list below «[a-z0-9_]{6,18}»
//    Between 6 and 18 times, as many times as possible, giving back as needed (greedy) «{6,18}»
//    A character in the range between “a” and “z” «a-z»
//    A character in the range between “0” and “9” «0-9»
//    The character “_” «_»

该工具还允许您在文档中选择一行,并显示正则表达式中的部分。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8968676

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档