亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1100 | 回復(fù): 5
打印 上一主題 下一主題

關(guān)于back reference的問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2005-09-06 14:11 |只看該作者 |倒序瀏覽
在研讀精華貼的過程中,發(fā)現(xiàn)如下內(nèi)容:

If the group doesn't participate in a match, i.e., it is part of an
alternative not taken or a repetition operator allows zero
repetitions of it, then the back reference makes the whole match
fail. For example, `(one()|two())-and-(three\2|four\3)' matches
`one-and-three' and `two-and-four', but not `one-and-four' or
`two-and-three'. For example, if the pattern matches `one-and-',
then its group 2 matches the empty string and its group 3 doesn't
participate in the match. So, if it then matches `four', then
when it tries to back reference group 3--which it will attempt to
do because `\3' follows the `four'--the match will fail because
group 3 didn't participate in the match.

百思不得其解    ,在Solaris bash環(huán)境中測試也未得結(jié)果,請大家?guī)兔忉屢幌,多謝多謝!
# cat tmp
one-and-three
two-and-four
one-and-four
two-and-three
# grep '\(one\(\)|two\(\)\)-and-\(three\2|four\3\)' tmp
#

論壇徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亞冠之浦和紅鉆
日期:2015-06-23 19:10:532015亞冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16賽季CBA聯(lián)賽之山東
日期:2016-01-31 18:25:0515-16賽季CBA聯(lián)賽之四川
日期:2016-02-16 16:08:30程序設(shè)計版塊每日發(fā)帖之星
日期:2016-06-29 06:20:002017金雞報曉
日期:2017-01-10 15:19:5615-16賽季CBA聯(lián)賽之佛山
日期:2017-02-27 20:41:19
2 [報告]
發(fā)表于 2005-09-06 14:34 |只看該作者

關(guān)于back reference的問題

grep -E '(one()|two())-and-(three\2|four\3)' tmp

論壇徽章:
0
3 [報告]
發(fā)表于 2005-09-06 14:43 |只看該作者

關(guān)于back reference的問題

[quote]原帖由 "waker"]grep -E '(one()|two())-and-(three\2|four\3)' tmp[/quote 發(fā)表:


這個我也試過了,也是沒有任何輸出結(jié)果,真奇怪!

論壇徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亞冠之浦和紅鉆
日期:2015-06-23 19:10:532015亞冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16賽季CBA聯(lián)賽之山東
日期:2016-01-31 18:25:0515-16賽季CBA聯(lián)賽之四川
日期:2016-02-16 16:08:30程序設(shè)計版塊每日發(fā)帖之星
日期:2016-06-29 06:20:002017金雞報曉
日期:2017-01-10 15:19:5615-16賽季CBA聯(lián)賽之佛山
日期:2017-02-27 20:41:19
4 [報告]
發(fā)表于 2005-09-06 14:51 |只看該作者

關(guān)于back reference的問題

沒有sunbox,在linux下是可以的GNU grep2.5.1

論壇徽章:
0
5 [報告]
發(fā)表于 2005-09-06 14:59 |只看該作者

關(guān)于back reference的問題

[quote]原帖由 "waker"]沒有sunbox,在linux下是可以的GNU grep2.5.1[/quote 發(fā)表:


果然,謝謝waker。我再查查solaris的man。另外,one和two后面的()是什么意思呀?

論壇徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亞冠之浦和紅鉆
日期:2015-06-23 19:10:532015亞冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16賽季CBA聯(lián)賽之山東
日期:2016-01-31 18:25:0515-16賽季CBA聯(lián)賽之四川
日期:2016-02-16 16:08:30程序設(shè)計版塊每日發(fā)帖之星
日期:2016-06-29 06:20:002017金雞報曉
日期:2017-01-10 15:19:5615-16賽季CBA聯(lián)賽之佛山
日期:2017-02-27 20:41:19
6 [報告]
發(fā)表于 2005-09-06 15:05 |只看該作者

關(guān)于back reference的問題

group 2 matches the empty string
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP