`
reverocean
  • 浏览: 195459 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

Special characters in regular expression

    博客分类:
  • Ruby
阅读更多
There are some special characters in Regular Expressions.Within a pattern,all characters except .,|,(,),[,],{,},+,\,^,$,*,and ? match themselves.They are the special characters.If you know their meaning in the Regular Expressions you can know why are they special.If you want to use themselves in patterns,you need add '\' before them.The following are the meaning of them:
  • '.':represents any character except a newline
  • '|':Its meaning is 'or'
  • '(' and ')':
  • '[' and ']':A character class is a set of characters between brackets:[characters] matches any single character between the brackets.
  • '{' and '}':
  • '+':follow a character or a () expression to express the character or expression must contains more than one times.
  • '\':
  • '^':a anchor.match the begining of a line
  • '$':a anchor.match the end of a line or ...
  • '*':
  • '?':
Copy the list of these from <the ruby way>:
评论

相关推荐

    Python_Regular_Expressions_-_Learn_Python_Regular_Expressions_in_an_Easy_Way.pdf.pdf

    "Chapter5: Special characters, module contents and Regular Expression Objects"涉及了正则表达式中的特殊字符、模块内容和正则表达式对象。这个部分解释了特殊字符在正则表达式中的作用,如何使用正则表达式对象...

    还不会正则表达式?赶快看这篇!.docx

    7. Special Characters (特别字符) 正则中存在一些特别字符,它们不会根据字面意思进行匹配,而有特别的意义。例如:^、$、|、() 等。 8. 实践应用 正则表达式可以用于匹配手机号码、电子邮件地址、手机号码、...

    UE(官方下载)

    If you've ever found yourself pulling your hair out trying to build the perfect regular expression to match the least amoun... Remove blank lines A question we often see is "I have a lot of blank ...

    Microsoft Codeview and Utilities User's Guide

    A.1 Special Characters in Regular Expressions A.2 Searching for Special Characters A.3 Using the Period A.4 Using Brackets A.4.1 Using the Dash within Brackets A.4.2 Using the Caret within Brackets A....

    python3.6.5参考手册 chm

    Operators And Special Methods Builtins Build and C API Changes Performance Porting To Python 3.0 What’s New in Python 2.7 The Future for Python 2.x Changes to the Handling of Deprecation ...

    C++ 标准 ISO 14882-2011

    traits)、类模板basic_regex(Class template basic_regex)、类模板sub_match(Class template sub_match)、类模板match_results(Class template match_results)、正则表达式算法(Regular expression ...

    PowerShellPack

    About_regular_expression.help.txt About_reserved_words.help.txt About_scope.help.txt About_script_block.help.txt About_shell_variable.help.txt About_signing.help.txt About_special_characters.help.txt ...

    ruby正则表达式规则

    在Ruby编程语言中,正则表达式(Regular Expression)是一种强大的文本处理工具,被广泛应用于字符串搜索与替换、数据验证以及模式匹配等场景。本篇文章将深入探讨Ruby中常用的正则表达式规则及其应用场景,帮助读者...

    Redhat系统管理员笔记

    - **正则表达式(Regular Expression)**:探讨Shell脚本中正则表达式的使用方法。 - **理论(Theory)**:讲解正则表达式的基本概念和匹配规则。 - **元字符(Meta Character)**:介绍Shell正则表达式中的元字符及其作用...

    Google C++ International Standard.pdf

    Contents Contents ii List of Tables x List of Figures xiv 1 Scope 1 2 Normative references 2 3 Terms and definitions 3 4 General principles 7 4.1 Implementation compliance . ....4.2 Structure of this ...

    一个java正则表达式工具类源代码.zip(内含Regexp.java文件)

    * Summary of regular-expression constructs 正则表达式结构简介: * Construct Matches * Characters 字符: * x The character x x 字符 x * \\ The ...

Global site tag (gtag.js) - Google Analytics