由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - regular expression中回车用什么表示?
相关主题
Regular expression的问题[转载] Help with Perl Regular Expression
Install GCC on AIXregular expression question
GCC 一问regular expessions in vi
还是只认3.6G内存,大虾分析一下把 (转载)I/O implementation question
[转载] 一个简单的regular expression问题how "egrep -is " work?
[转载] Re: 一个简单的regular expression问题How to remove a line from a file?
Regular expressionunix commands question
Regular ExpressionsHelp! How to replace string in a variable?
相关话题的讨论汇总
话题: grep话题: expression话题: egrep话题: 中回话题: regular
进入Unix版参与讨论
1 (共1页)
F***Q
发帖数: 6599
1
要查找文件中的特定的行末标志比如
0<回车>
40<回车>
能否用regular expression来查找,就向word中的^p一样
thx!
m*****e
发帖数: 4193
2
know C? '\n'

【在 F***Q 的大作中提到】
: 要查找文件中的特定的行末标志比如
: 0<回车>
: 40<回车>
: 能否用regular expression来查找,就向word中的^p一样
: thx!

F***Q
发帖数: 6599
3
但是我用
grep '0\n40\n' myfile
却找不到:(

【在 m*****e 的大作中提到】
: know C? '\n'
m*****e
发帖数: 4193
4
1. which grep are you using? You should use GNU grep or egrep.
2. make sure your lines do not end with '\r\n' like most files
edited under DOS

【在 F***Q 的大作中提到】
: 但是我用
: grep '0\n40\n' myfile
: 却找不到:(

c*****t
发帖数: 1879
5
hmm, I don't think that egrep can do that either. It buffers
only a line.

【在 m*****e 的大作中提到】
: 1. which grep are you using? You should use GNU grep or egrep.
: 2. make sure your lines do not end with '\r\n' like most files
: edited under DOS

F***Q
发帖数: 6599
6
I use AIX 4.3
both grep and egrep give me the first line of the file when
i use
?grep '\n' myfile
but can't find all of the lines,also,the specified line I
am searching
sed even dosen't accept '\n':(

【在 c*****t 的大作中提到】
: hmm, I don't think that egrep can do that either. It buffers
: only a line.

m*****e
发帖数: 4193
7
No idea. GNU grep works for me on both Linux and Solaris.

【在 F***Q 的大作中提到】
: I use AIX 4.3
: both grep and egrep give me the first line of the file when
: i use
: ?grep '\n' myfile
: but can't find all of the lines,also,the specified line I
: am searching
: sed even dosen't accept '\n':(

t*********l
发帖数: 30
8
sed -n '/0$/{N;/04$/p}' yourfil

【在 F***Q 的大作中提到】
: 但是我用
: grep '0\n40\n' myfile
: 却找不到:(

1 (共1页)
进入Unix版参与讨论
相关主题
Help! How to replace string in a variable?[转载] 一个简单的regular expression问题
Re: Thank you and.Re: a question about lower IO[转载] Re: 一个简单的regular expression问题
Please HELP on hexdumpRegular expression
重定向操作是什么时候返回的?Regular Expressions
Regular expression的问题[转载] Help with Perl Regular Expression
Install GCC on AIXregular expression question
GCC 一问regular expessions in vi
还是只认3.6G内存,大虾分析一下把 (转载)I/O implementation question
相关话题的讨论汇总
话题: grep话题: expression话题: egrep话题: 中回话题: regular