ChinaUnix.net
相关文章推荐:

正则表达式 换行

:em14: :em14:

by 一刀砍死 - Perl - 2008-08-18 08:33:38 阅读(2047) 回复(3)

相关讨论
by cate1019 - Perl - 2010-06-10 09:30:23 阅读(59536) 回复(11)

比如有一个正则表达式 /\n[^\n]+/ 我想取一个换行以及后面的字符,但后面的字符不能包括换行.也就是如何在[ ]中包括换行? [ 本帖最后由 dream3401 于 2009-3-5 07:37 编辑 ]

by dream3401 - Shell - 2009-03-05 09:27:21 阅读(5119) 回复(11)

本帖最后由 bzdghdn 于 2010-11-26 13:10 编辑 小弟想写一个正则表达式检测一个字符串中是否不含有换行符,我觉的表达式"^[^\n]+$"表示字符串从开始到结束由一个或多个非换行符组成,所以[code]#!/usr/bin/perl my %string = ("abc\n"=>'abc\n',"\nabc"=>'\nabc',"a\nbc"=>'a\nbc'); #换行符在最后,换行符在最前,换行符在中间 for(keys %string) { if (/^[^\n]+$/) { print $string{$_},' ma...

by bzdghdn - Perl - 2010-11-26 13:16:30 阅读(6036) 回复(3)

有一个数据库的导出文本,大体上一条记录导出为一个文本文件,内容大致如下: 标题="工作报告", 日期="20090612", [x8j1356dqd]内容=" 2009年工作报告    随着。。。。。 我们。。。。。。 所以。。。。。。   最后,。。。。。 "[x8j1356dqd]作者="张三" 如例子中所示: 1、共有4个字段,分别是标题、日期、内容、作者(实际中可能比这个多),字段与字段之间可以换行,也可以在同一行上,以逗号分开。 2、每个字段的内...

by sjhf - Shell - 2009-07-10 07:58:09 阅读(5183) 回复(11)

本帖最后由 yshihyu 于 2014-10-06 19:37 编辑 [code]+12 -23 +23.456 -236.23 123.0 123 234352345[/code][0-9]+\.[0-9]+|\+\d+|\-\d+|\+[0-9]+\.[0-9]+|\d+ 我这样写好像也是有问题~ , 请问上面数据要怎么写出简洁的正则表达式 thanks

by yshihyu - Python - 2014-10-07 21:42:58 阅读(1352) 回复(3)

[root@linjianying ~]# cat shell welcome to iphonebar.net iphone belongs me [root@linjianying ~]# grep -E '+me' shell --color welcome to iphonebar.net me 疑问:+表示它前面的字符至少出现1次,为什么me还会被过滤出来呢?me前面没有字符的啊。

by zjlinjianying - Shell - 2013-12-05 09:04:31 阅读(2022) 回复(4)

本帖最后由 chenzhanyiczy 于 2013-10-31 15:59 编辑 man regex Within a bracket expression, a collating element (a character, a multi-character sequence that collates as if it were a single character, or a collating-sequence name for either) enclosed in "[." and ".]" stands for the sequence of characters of that collating element. The sequence is a single element of the brac...

by chenzhanyiczy - Shell - 2013-11-01 13:08:45 阅读(2270) 回复(4)

man regex Within a bracket expression, a collating element (a character, a multi-character sequence that collates as if it were a single character, or a collating-sequence name for either) enclosed in "[." and ".]" stands for the sequence of characters of that collating element. The sequence is a single element of the bracket expression’s list. A bracket expressio...

by chenzhanyiczy - C/C++ - 2013-11-01 10:06:07 阅读(2313) 回复(7)

正则表达式中的一些符号不是太理解,哪位有关于正则文档,小弟多谢了!:em27:

by LikeLx - Shell - 2013-10-11 17:03:57 阅读(2921) 回复(5)

工作中一直用不到,最近想学习下,发现这个东西真是好。从网上找了个语法,试着些一个:找C语言函数名的正则表达式,调好之后,发现是.net下的语法,各个语言中的正则表达式竟然语法还不同。linux下shell里面弄了一下午没搞定。 1、求linuxshell下的找C语言函数名的正则表达式 2、求正则表达式的电子书 3、问:哪个语言下的正则表达式使用广泛 白天无法上网,只能晚上发帖,helpme,3ks

by eveson - Shell - 2013-08-09 08:27:37 阅读(4871) 回复(5)