( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKBase.class.php on line 114
Call Stack
#TimeMemoryFunctionLocation
10.0005416176{main}( ).../index.php:0
20.08574721768Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.388714262216Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.389014262160Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.389014262536Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.389014262536Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.389214262632Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.390214302552require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.395814600240GKTemplate->__construct( ).../component.php:31
100.403014769616GKTemplateMenu->getMenuType( ).../gk.framework.php:84
110.403914814472require_once( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKMenu.php' ).../helper.menu.php:19

( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKHandheld.php on line 76
Call Stack
#TimeMemoryFunctionLocation
10.0005416176{main}( ).../index.php:0
20.08574721768Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.388714262216Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.389014262160Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.389014262536Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.389014262536Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.389214262632Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.390214302552require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.395814600240GKTemplate->__construct( ).../component.php:31
100.406114942416GKTemplateMenu->getMenuType( ).../gk.framework.php:85
批处理FINDSTR正则表达式用法实例分析
Logo
Print this page

批处理FINDSTR正则表达式用法实例分析

dos或批处理下findstr正则用法,会了这个我们就可以用批处理实现文本等搜索替换等
 
 
1.findstr . 2.txt 或 Findstr "." 2.txt 
从文件2.txt中查找任意字符,不包括空字符或空行 

2.findstr .* 2.txt 或 findstr ".*" 2.txt 
从文件2.txt中查找任意字符包括空行和空字符 

3.findstr "[0-9]" 2.txt 
从文件2.txt中查找包括数字0-9的字符串或行 

4.findstr "[a-zA-Z]" 2.txt 
从文件2.txt中查找包括任意字符的字符串或行 

5.findstr "[abcezy]" 2.txt 
从文件2.txt中查找包括a b c e z y字母的字符串或行 

6.findstr "[a-fl-z]" 2.txt 
从文件2.txt中查找小写字符a-f l-z的字符串,但不包含g h I j k这几个字母。 

7.findstr "M[abc][hig]Y" 2.txt 
从文件2.txt中可以匹配 MahY , MbiY, MahY等….. 

8. ^和$符号的应用 
^ 表示行首,"^step"仅匹配 "step hello world"中的第一个单词 
$ 表示行尾,"step$"仅匹配 "hello world step"中最后一个单词 

9.finstr "[^0-9]" 2.txt 
如果是纯数字的字符串或者行便过滤掉,例如2323423423 这样的字符串,如果是345hh888这样的形式就不成了。 

10.findstr "[^a-z]" 2.txt 
同上,如果是纯字母的字符串或者行便过滤掉,例如 sdlfjlkjlksjdklfjlskdf这样的字符,如果是sdfksjdkf99999这样的形式,掺杂着数字就不成了 

11.*号的作用 
前面已经说过了 ".*"表示搜索的条件是任意字符,*号在正则表达式中的作用不是任何字符,而是表示左侧字符或者表达式的重复次数,*号表示重复的次数为零次或者多次。 

12.findstr "^[0-9]*$" 2.txt 
这个是匹配找到的纯数字,例如 234234234234,如果是2133234kkjl234就被过滤掉了。 
Findstr "^[a-z]*$" 2.txt 
这个是匹配找到的纯字母,例如 sdfsdfsdfsdf,如果是213sldjfkljsdlk就被过滤掉了 
如果在搜索条件里没有*号,也就是说不重复左侧的搜索条件,也就是[0-9] [a-z]那只能匹配字符串的第一个字符也只有这一个字符,因为有行首和行尾的限制,"^[0-9]$"第一个字符如果是数字就匹配,如果不是就过滤掉,如果字符串是 9 就匹配,如果是98或者9j之类的就不可以了。 

13. "\<…\>"这个表达式的作用 
这个表示精确查找一个字符串,\<sss 表示字的开始位置,sss\>表示字的结束位置 
echo hello world computer|findstr "\<computer\>"这样的形式 
echo hello worldcomputer|findstr "\<computer\>" 这样的形式就不成了,他要找的是 "computer"这个字符串,所以不可以。 
echo hello worldcomputer|findstr ".*computer\>"这样就可以匹配了

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
Call Stack
#TimeMemoryFunctionLocation
10.0003416128{main}( ).../index.php:0
20.09174721752Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.09174721752Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.315812450208Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.316712474920Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.317712530248Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.318112559072require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.328412994480K2ControllerItem->execute( ).../k2.php:64
90.328412994480K2ControllerItem->display( ).../BaseController.php:710
100.340913719680K2ControllerItem->display( ).../item.php:78
110.340913719680K2ControllerItem->display( ).../controller.php:19
120.346814116048Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.348814136416K2ViewItem->display( ).../ViewController.php:102
140.476517102400K2ViewItem->display( ).../view.html.php:742
150.476517102400K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.480517282600include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701

( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
Call Stack
#TimeMemoryFunctionLocation
10.0003416128{main}( ).../index.php:0
20.09174721752Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.09174721752Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.315812450208Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.316712474920Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.317712530248Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.318112559072require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.328412994480K2ControllerItem->execute( ).../k2.php:64
90.328412994480K2ControllerItem->display( ).../BaseController.php:710
100.340913719680K2ControllerItem->display( ).../item.php:78
110.340913719680K2ControllerItem->display( ).../controller.php:19
120.346814116048Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.348814136416K2ViewItem->display( ).../ViewController.php:102
140.476517102400K2ViewItem->display( ).../view.html.php:742
150.476517102400K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.480517282600include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
Template Design © Joomla Templates | GavickPro. All rights reserved.