1
kyrre OP 目前搜到离答案最近的是
http://stackoverflow.com/questions/406230/regular-expression-to-match-a-line-that-doesnt-contain-a-word 但悲剧的是我自己用 grep '^((?!hede).)*$' b.txt 居然没用。 |
3
54c3 2017 年 3 月 2 日 |
4
54c3 2017 年 3 月 2 日
|
5
langmoe 2017 年 3 月 2 日 http://regex.alf.nu/
考验功力上这个啊 |
6
hellogbk 2017 年 3 月 2 日
^(?!.*hede.*).*$
|
7
ProkillerJ 2017 年 3 月 2 日
5 楼那个网站已经把正则玩出花了,不怕虐的可以去试一下
|
8
DiamondbacK 2017 年 3 月 2 日
Use `grep -P pattern`.
|
9
wojiaodaxiaxia 2017 年 3 月 2 日
6 楼应该是最准确直观的答案了吧
|
11
kinghs 2017 年 3 月 2 日 via iPhone
^(?!.*hede).*$
|
12
ColinZeb 2017 年 3 月 2 日
@langmoe afoot|catfoot|dogfoot|fanfoot|foody|foolery|foolish|fooster|footage|foothot|footle|footpad|footway|hotfoot|jawfoot|mafoo|nonfood|padfoot|prefool|sfoot|unfool
|
14
pysama 2017 年 3 月 2 日
/^(?!.*hede).*$/gi
|
16
kyrre OP |
21
lianyue 2017 年 3 月 2 日
js
/(^|\n)((?:(?!hede).)+)(?=\n|$)/g ..其他的 支持 后断言 的 /(?<=^|\n)(?:(?!hede).)+(?=\n|$)/g |
23
mdzz 2017 年 3 月 2 日
LZ 可能是想要一个 ABAB 叠字的正则
|
26
kyrre OP |
27
nicevar 2017 年 3 月 3 日
正则功力几乎为 0 ,每次都是用的时候不断尝试,或者直接问同事
|
28
flfwzgl 2017 年 3 月 3 日
`hoho
hihi haha fahedewwf`.replace(/\n.*hede.*\n?/g, '\n') |