﻿功能:正则表达式搜索(文本、指定文件搜索、搜索文件名)

格式:
RegularExpressions(Reg,Path,Type)
RegularExpressions(Reg,Path)
RegularExpressions(Reg)
Reg:符号变量.里面存储的正则表达式.
Path:为符号变量或者命令,为符号变量时存储路径或者命令
Type:为符号变量或者命令,为符号变量时存储命令.当要在多个文件搜索或者多个文件夹搜索时,指定对应的Type可以执行不同的功能.

说明:
1、RegularExpressions(Reg):按照Reg正则表达式在当前屏幕进行全屏搜索
2、RegularExpressions(Reg,Path):当path是一个存在的文本文档时,按照Reg正则表达式搜索path文档里的内容;否则,直接在path所代表的符号变量内容里进行搜索.
3、RegularExpressions(Reg,Path,Type):如果Path不是一个文件夹目录,如图Type为Screen则本命令等价于RegularExpressions(Reg),否则返回一个错误.如果path为一个文件夹目录,按如下格式执行:
3.1、Type为SearchFile:在Path目录下的全部文本文档里进行搜索,但不搜索子目录里的文件.
3.2、Type为SearchAllFile:在Path目录下的全部文本文档里进行搜索,且要搜索子目录里的文件.
3.3、Type为SearchFileName:对Path目录下的全部文件名进行匹配,但不包括子目录里的文件.
3.4、Type为SearchAllFileName:对Path目录下的全部文件名进行匹配,且要包括子目录里的文件.
3.5、Type为其它内容,返回一个错误提示.

函数执行完毕,返回以符号变量存储的结果.

例子:

dir="D:\英文参考";reg="(?i)n";type="SearchAllFileName";x=RegularExpressions(reg,dir,type)//本命令的含义是在【D:\英文参考】这个文件下搜索文件名含有【n】的文件,其中搜索时不区分大小写。回车后得到如下结果
x = "1:d:\英文参考\Finite difference schemes for two-dimensional miscible displacement ﬂow in porous media on composite triangular grids.pdf
2:d:\英文参考\Mixed-dimensional coupling in finite element models.pdf
3:d:\英文参考\Numerical simulation of temperature effects at fissures due to shock loading.pdf
4:d:\英文参考\Prediction of the non-ideal detonation performance of commercial explosives using the DeNE and JWL++ codes.pdf
5:d:\英文参考\Propagation of impact-induced shock waves in porous sandstone using mesoscale modeling.pdf
6:d:\英文参考\Shock compression and isentropic release of granite.pdf
7:d:\英文参考\Shock-wave equation of state of rhyolite.pdf
8:d:\英文参考\Two- and three-dimensional transition element families for adaptive refinement analysis of elasticity problems.pdf
9:d:\英文参考\Visco-damage tension model for rocks in ground-shock applications.pdf"