Microsoft Word Regular Expression
Microsoft Word Regular Expression
Word裏的正則表達式-不一樣的符號。
一、Normal Find and Replace
二、Search by using wildcards/利用通配符(*)搜索
1、Expressions in wildcards searches
Use parentheses ( ) to create groups of wildcard characters and text in the Find What box, and then use \n in the Replace With box to use the results of each expression.
用括号()在Find What输入框中去创建包含wildcard字符和文本的分组,然后在Replace With输入框中用\n去代替每个表达式。注意:n是 分组/group 的序号。比如有5个(,即创建了5格分组,则n可以是是1至5中的任意一个值。
You can use the \n wildcard to search for an expression and then replace it with the rearranged expression. For example, type (Ashton) (Chris) in the Find what box and \2 \1 in the Replace with box. Word will find Ashton Chris and replace it with Chris Ashton.
可以利用\n通配符去搜索一个表达式,并用重新排序的表达式替换。比如在Find what框中输入(Ashton) (Chris),在Replace with框中输入\2 \1。Word会搜索Ashton Chris,并用Chris Ashton去替换,也就是说:将第2组与第1组交换顺序。
2、Wildcards for items you want to find and replace/常用 wildcard/通配符
- When the Use wildcards check box is selected, Word finds only the exact text that you specify. Notice that the Match case and Find whole words only check boxes are unavailable (dimmed) to indicate that these options are automatically turned on. You can't turn off these options.
- To search for a character that's defined as a wildcard, type a backslash () before the character. For example, type \? to find a question mark or \ to find a backslash character (this is often called an “escape character”).用 backslash/反斜线,即在字符前加一个反斜线(),来搜索 通配符/wildcard。比如输入 \?来搜索 ?/问号。
- You can use parentheses to group the wildcard characters and text and to indicate the order of evaluation. For example, type <(pre)*(ed)> to find "presorted" and "prevented".利用()/英文括号将通配符和文本分组。
| To find | Type | Example |
|---|---|---|
| Any single character, including space and punctuation characters | ? | s?t finds sat, set, and s t. |
| One of these characters | [ ] | w[io]n finds win and won. |
| Any single character in this range | [-] | [r-t]ight finds right, sight,tight. Ranges must be in ascending order. |
| The beginning of a word | < | <(inter) finds interesting and intercept, but not splintered. |
| The end of a word | > | (in)> finds in and within, but not interesting. |
| Expression | () | Word remembers the results of a search combination to use in a replace operation. |
| Any single character except the characters in the range inside the brackets | [!x-z] | t[!a-m]ck finds tock and tuck, but not tack or tick. |
| Exactly n occurrences of the previous character or expression | {n} | fe{2}d finds feed but not fed. |
| At least n occurrences of the previous character or expression | {n,} | fe{1,}d finds fed and feed. |
| From n to m occurrences of the previous character or expression | {n,m} | 10{1,3} finds 10, 100, and 1000. |
| One or more occurrences of the previous character or expression | @ | lo@t finds lot and loot. |
| Any string of characters, including space and punctuation characters | * | s*d finds sad, started, and significantly altered. |
注意:上边的这个表格使用Cnblog的Markdown编辑器自动生成的,暂时不知道如何设置表格的属性-文本对齐、换行。
三、Use codes to find letters, formatting, fields, or special characters
1、Code that work in the Find What box or Replace With box.
| To find | Type |
|---|---|
| Paragraph mark ( ¶) | ^p (doesn't work in the Find what box when the Use wildcards option is turned on), or ^13 |
| Tab character ( tab character ) | ^t or ^9 |
| ASCII character | ^ nnn, where nnn is the character code |
| ANSI character | ^0 nnn, where 0 is zero and nnn is the character code |
| Em dash (—) | ^+ |
| En dash (–) | ^= |
| Caret character | ^^ |
| Manual line break ( manual line break ) | ^l or ^11 |
| Column break | ^n or ^14 |
| Page or section break | ^12 (when replacing, inserts a page break) |
| Manual page break | ^m (also finds or replaces section breaks when the Use wildcards option is turned on) |
| Nonbreaking space ( nonbreaking space ) | ^s |
| Nonbreaking hyphen ( nonbreaking hyphen ) | ^~ |
| Optional hyphen ( optional hyphen ) | ^- |
四、Find and replace text by using regular expressions (Advanced)
1、About Regular Expression
You can automate many find-and-replace tasks by using wildcard characters to build regular expressions, which are combinations of literal text and wildcard characters. The literal text characters indicate text that must exist in the target string of text. The wildcard characters indicate the text that can vary in the target string. For example, you can use regular expressions to find and remove duplicate rows from a large table or to transpose a list of names (change them from "First Last" to "Last, First").
2、
參考:
Microsoft Word Regular Expression的更多相关文章
- Regular Expression(正则表达式)之邮箱验证
正则表达式(regular expression, 常常缩写为RegExp) 是一种用特殊符号编写的模式,描述一个或多个文本字符串.使用正则表达式匹配文本的模式,这样脚本就可以轻松的识别和操作文本.其 ...
- Regular Expression Syntax
python的正则表达式 正则表达式的概念 正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特定字符.及这些特定字符的组合,组成一个"规则字符串",这个"规 ...
- [转]The Regular Expression Object Model
本文转自:https://docs.microsoft.com/en-us/dotnet/standard/base-types/the-regular-expression-object-model ...
- grep(Global Regular Expression Print)
.grep -iwr --color 'hellp' /home/weblogic/demo 或者 grep -iw --color 'hellp' /home/weblogic/demo/* (-i ...
- Python中的正则表达式regular expression
1 match = re.search(pat,str) If the search is successful, search() returns a match object or None o ...
- Python正则表达式Regular Expression基本用法
资料来源:http://blog.csdn.net/whycadi/article/details/2011046 直接从网上资料转载过来,作为自己的参考.这个写的很清楚.先拿来看看. 1.正则表 ...
- Python 模块 re (Regular Expression)
使用 Python 模块 re 实现解析小工具 概要 在开发过程中发现,Python 模块 re(Regular Expression)是一个很有价值并且非常强大的文本解析工具,因而想要分享一下此 ...
- python learning Regular Expression.py
# 正则表达式,又称规则表达式.(英语:Regular Expression,在代码中常简写为regex.regexp或RE),计算机科学的一个概念.正则表达式通常被用来检索.替换那些符合某个模式(规 ...
- Java基础-正则表达式(Regular Expression)语法规则简介
Java基础-正则表达式(Regular Expression)语法规则简介 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.正则表达式的概念 正则表达式(Regular Exp ...
随机推荐
- hibernate学习五(关系映射多对一与一对多)
一.多对一 多对一(或者一对多):在学生与老师的情况下,一个老师可以教多个学生,但一个学生只能被教一个老师教: 对于类:在多的那方拥有一的那方的一个实体 二.修改student.java和teache ...
- linux安装oracle
目 录 一.硬件要求二.软件三.系统安装注意四.安装Oracle前的系统准备工作五.安装Oracle,并进行相关设置六.升级Oracle到patchset 10.2.0.4七.使用rlwrap调用sq ...
- mysql服务的启动和停止 net stop mysql net start mysql
第一招.mysql服务的启动和停止 net stop mysql net start mysql 第二招.登陆mysql 语法如下: mysql -u用户名-p用户密码 键入命令mysql -uroo ...
- 【22】将成员变量声明为private
1.为什么要将成员变量声明为private,语法一致性,只通过方法暴露接口. 2.使用方法,可以对成员变量更精确的控制.比如:为所有可能的实现提供弹性,不同实现可以替换:控制可读可写:验证约束条件:处 ...
- iOS利用视频做起始页
一个好的引导页会使得用户体验大大提升,利用视频来做,可以更简单的达到优雅的效果.使用MediaPlayer.framework框架下的AVPlayerLayer,它和Core Animation紧密地 ...
- android4.4短信新概念
android4.4对短信引入了一个全新的概念:默认短信应用.即android用户可以在系统设置里面选择一个默认的短信应用,只有这个应用才能进行手机的基本短信操作.按照google自己的解释这样做的原 ...
- iOS开发——新特性OC篇&IOS9 系统新特性
IOS9 系统新特性 2015年6月89号凌晨召开的WWDC 2015苹果开发者大会发布了全新的iOS 9系统,PC6小编今天给大家整理了这次iOS9的系统更新带来了哪些新的功能与升级,本次新功能一览 ...
- max_user_connections 与 max_connections,max_connect_errors, nr_open, file-max
LINUX文件设置: ulimit -n <num> ----> [/etc/profile,/.bashrc] ---->/etc/security/limits.conf ...
- Memcached source code analysis (threading model)--reference
Look under the start memcahced threading process memcached multi-threaded mainly by instantiating mu ...
- android studio的里的 content_XXX_xml问题
遇到这个问题就是androidStudio的版本问题,androidStudio会出现这个问题是在androidStudio1.4以上版本当遇到这个问题的时候建Activity的时候选择EmptyAc ...