正则表达式的含义

正则表达式的含义

本文介绍了正则表达式的含义--\\ d,\\ D,^,$等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些表达是什么意思?我在哪里可以了解它们的用法?

What do these expressions mean? Where can I learn about their usage?

\\d
\\D
\\s
\\S
\\w
\\W
\\t
\\n
^
$
\
|  etc..

我需要使用stringr软件包,我完全不知道如何使用它们.

I need to use the stringr package and i have absolutely no idea how to use these .

推荐答案

扩展正则表达式部分的?regexp中:

类似Perl的正则表达式:

请注意,反斜杠通常需要在R输入中加倍/保护,例如您将使用"\\h"来匹配水平空间.

Note that backslashes usually need to be doubled/protected in R input, e.g. you would use "\\h" to match horizontal space.

来自?Quotes:

正如上面的其他评论所述,如果您是第一次开始使用正则表达式,则可能需要更多帮助.对于StackOverflow(链接到场外资源)来说,这有点偏离主题,但是 gsubfn软件包概述.还是Google的正则表达式教程" ...

As others comment above, you may need a little more help if you're getting started with regular expressions for the first time. This is a little bit off-topic for StackOverflow (links to off-site resources), but there are some links to regular expression resources at the bottom of the gsubfn package overview. Or Google "regular expression tutorial" ...

这篇关于正则表达式的含义--\\ d,\\ D,^,$等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 08:44