The pcretest tool lets you test Perl regexps.
通过pcretest工具对Perl regexp进行测试。
contrast to the handling of regexps in programs such as `grep'.
一个补集合可以匹配换行符,除非换行符被指定为补集合中的一个字符。 这不同 于某些象“grep”的程序对正则表达式的处理。
Start txt2regex and specify regexps for grep, sed, and emacs.
启动txt2regex并指定构建用于grep、sed和Emacs的regexp。
These tools give powerful ways to craft, test, and hone regexps.
这些工具提供了强大的功能,用于编写、测试和优化 regexp。
I began by using Perl5 regular expressions (regexps) occasionally.
开始的时候,我偶尔会使用Perl5正则表达式(regexp)。
And one way to look at your regexps in context is to mark them in the output.
在上下文中查看您的regrxp的一个方法就是在输出中对其进行标识。
You had used regexps for egrep, sed, and perl; now try building it for plain grep.
前面已经使用了适用于egrep、sed和perl的regexp,现在我们将尝试构建适用于普通grep的regexp。
It won't always be the case that the regexps you build look the same for all chosen applications.
为所选择的应用程序构建的regexp并非总是完全相同。
If your shell supports escape sequences, you can highlight all the regexps in the context of the file.
如果您的外壳支持转义序列,则可以在文件的上下文中突出显示所有regexp。
Finally, the regex man page, available on many UNIX systems, provides information on building POSIX regexps.
最后,很多UNIX系统上提供的regex手册页提供了有关构建POSIX regexp的信息。
Using these tools and techniques on a UNIX system is probably the best way to learn to build complex regexps.
在UNIX系统上使用这些工具和技术可能是了解如何构建复杂regexp的最佳方法。
The pcrepattern man page (distributed with the pcretest application, as described above) also describes Perl regexps.
pcrepattern 手册页(随 pcretest应用程序分发,如上面所述)也对Perl regexp 进行了描述。
With no options, txt2regex defaults to build regexps for the perl, PHP, postgres, python, sed, and vim applications.
在没有选项的情况下,txt2regex会缺省为perl、php、postgres、python、sed和vim应用程序构建regexp。
Regexps are also popularly used in the Perl language, but Perl regexps are different from those you'd build using grep.
regexp在Perl语言中也很常用,但 Perl regexp 与使用grep构建的 regexp不同。
Now that you've selected exactly what you want, you can see the desired regexps for all three applications in Figure 4.
现在已经选择了自己所希望的准确内容,就应该可能看到所有三个应用程序所需的regexp,如图4中所示。
The — showinfo option just outputs a brief summary of information about building regexps for a particular program or language.
showinfo选项可直接输出关于构建特定程序或语言的regexp的信息的简短摘要。
The concept of regular expressions (regexps) -a notation for describing a pattern that matches a set of strings-is common across many programs and languages.
正则表达式(regular expression,regexp)是用于描述字符串集的匹配模式的概念,在很多程序和语言中都是通用的。
You can use this tool to familiarize yourself with the Perl-compatible regular expression (PCRE) library and to debug or test regexps that you build with it.
可以使用此工具来熟悉兼容perl的正则表达式(Perl - compatibleregular expression,pcre)库和调试或测试使用其构建的regexp。
The use of -o and some test data are helpful in building regexps, because you might have assumed that the regexp worked as lines containing "th" were matched.
通过使用- o和一些测试数据,可以帮助进行regexp的构建,因为您可能会假定此regexp会像匹配包含“th”的行一样工作。
These various regexp implementations differ to some degree in the finery of their details, but the principles for learning to build regexps are common for all.
这些不同的regexp实现在其细节方面存在一些差别,但构建regexp的原则全部都是通用的。
The Perl documentation (usually packaged and distributed separately from the main Perl source or binary package) contains a comprehensive man page on Perl regexps.
Perl文档(通常与主perl源代码或二进制包分开打包和分发)包含有关Perlregexp的完整手册页面。
Another useful txt2regex option is — showmeta, which outputs a table consisting of all the metacharacters used in building regexps for the supported applications.
另一个有用的txt2regex选项是——showmeta,此选项可输出包含为所支持的应用程序构建regexp时使用的所有元字符的表。
But as you build intricate regexps and have large datasets or input files, it can become considerably more difficult to know which string or strings a regexp might match.
但在构建复杂的regexp而且具有大型数据集或输入文件时,要知道regexp可能匹配哪些字符串可能就会困难得多。
Yes, all three of the regexps happen to be written as the identical t [a-z], but that's only because this is a simple regexp and the three chosen applications have a similar regexp syntax.
是的,所有三个regexp碰巧都是完全相同的(t [a - z]),但这仅仅是因为这个regexp很简单,而且所选择的三个应用程序具有类似的regexp语法。
Say, for example, that you want to construct the two regexps you used in the Show only the matches, not the lines section. The first one was a single word of uppercase or lowercase letters.
例如,假定您希望构造两个在仅显示匹配部分,而不显示行部分中使用的regexp。
When you run through the above, you'll find that the first four applications use the same regexp you used with grep in Listing 4, but the regexps for sed and vim are just a little different.
执行上面的步骤时,将发现前四个应用程序使用的regexp与清单4中的grep使用的完全相同,而sed和vim的regexp仅有一点差别。
This option is for collecting data that matches a regexp-it's great for harvesting IP addresses, URLs, names, E-mail addresses, words, and the like-but it's also a great way to learn regexps.
此选项用于收集匹配regexp的数据——非常适合用于收集IP地址、URL、名称、电子邮件地址、单词之类的信息——但对了解regexp也很有帮助。
This option is for collecting data that matches a regexp-it's great for harvesting IP addresses, URLs, names, E-mail addresses, words, and the like-but it's also a great way to learn regexps.
此选项用于收集匹配regexp的数据——非常适合用于收集IP地址、URL、名称、电子邮件地址、单词之类的信息——但对了解regexp也很有帮助。
应用推荐