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

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
123
最近訪問板塊 發(fā)新帖
樓主: aku1
打印 上一主題 下一主題

一個(gè)抽取的問題 [復(fù)制鏈接]

論壇徽章:
13
雙魚座
日期:2013-10-23 09:30:05數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2016-04-20 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-03-09 06:20:002015亞冠之塔什干火車頭
日期:2015-11-02 10:07:452015亞冠之德黑蘭石油
日期:2015-08-30 10:07:07數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-08-28 06:20:00數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2015-08-05 06:20:002015年迎新春徽章
日期:2015-03-04 09:57:09辰龍
日期:2014-12-03 14:45:52酉雞
日期:2014-07-23 09:46:23亥豬
日期:2014-03-13 08:46:22金牛座
日期:2014-02-11 09:36:21
21 [報(bào)告]
發(fā)表于 2015-07-23 11:17 |只看該作者
本帖最后由 bikong0411 于 2015-07-23 11:18 編輯

回復(fù) 20# MMMIX
  1. cat 1.pl
  2. $str='02/07/2015  *    L    2014:0306.1  [RHSA-2014:0159-01] Important: kernel
  3. security and bug fix update';

  4. print split(/[][]/, $str)[1];
  5. $perl 1.pl
  6. syntax error at 1.pl line 4, near ")["
  7. Execution of 1.pl aborted due to compilation errors.
  8. $ perl -v

  9. This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
  10. (with 2 registered patches, see perl -V for more detail)

  11. Copyright 1987-2013, Larry Wall

  12. Perl may be copied only under the terms of either the Artistic License or the
  13. GNU General Public License, which may be found in the Perl 5 source kit.

  14. Complete documentation for Perl, including FAQ lists, should be found on
  15. this system using "man perl" or "perldoc perl".  If you have access to the
  16. Internet, point your browser at http://www.perl.org/, the Perl Home Page.
復(fù)制代碼

論壇徽章:
0
22 [報(bào)告]
發(fā)表于 2015-07-23 15:46 |只看該作者
[oss@localhost log]$ cat line.log
02/07/2015  *    L    2014:0306.1  [RHSA-2014:0159-01] Important: kernel security and bug fix update
10/12/2015       L    2014:2962.1  [RHSA-2014:1655-01] Moderate: libxml2 security update
[oss@localhost log]$ perl -e '{@t=`cat line.log`;grep{if($_=~/(^\d.*?\d{4}).*?(\[.*\]).*/){print "$1\t$2\n";};}@t}'
02/07/2015      [RHSA-2014:0159-01]
10/12/2015      [RHSA-2014:1655-01]

論壇徽章:
307
程序設(shè)計(jì)版塊每周發(fā)帖之星
日期:2016-04-08 00:41:33操作系統(tǒng)版塊每日發(fā)帖之星
日期:2015-09-02 06:20:00每日論壇發(fā)貼之星
日期:2015-09-02 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-04 06:20:00每日論壇發(fā)貼之星
日期:2015-09-04 06:20:00每周論壇發(fā)貼之星
日期:2015-09-06 22:22:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-09 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-19 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-20 06:20:00每日論壇發(fā)貼之星
日期:2015-09-20 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-22 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-24 06:20:00
23 [報(bào)告]
發(fā)表于 2016-09-11 20:31 |只看該作者

你寫的代碼有問題, 肯定會(huì)報(bào)錯(cuò)啊!

論壇徽章:
307
程序設(shè)計(jì)版塊每周發(fā)帖之星
日期:2016-04-08 00:41:33操作系統(tǒng)版塊每日發(fā)帖之星
日期:2015-09-02 06:20:00每日論壇發(fā)貼之星
日期:2015-09-02 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-04 06:20:00每日論壇發(fā)貼之星
日期:2015-09-04 06:20:00每周論壇發(fā)貼之星
日期:2015-09-06 22:22:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-09 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-19 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-20 06:20:00每日論壇發(fā)貼之星
日期:2015-09-20 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-22 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-24 06:20:00
24 [報(bào)告]
發(fā)表于 2016-09-11 20:38 |只看該作者
  1. perl -ple '($_)=/\[([^]]+)/' f
復(fù)制代碼

論壇徽章:
0
25 [報(bào)告]
發(fā)表于 2016-09-16 20:38 |只看該作者
  1. #!/usr/bin/perl

  2. use warnings;
  3. use strict;

  4. while (<>) {
  5.         chomp;
  6.         if (/(\d+\/\d+\/\d+).*?(\[\S+\])/) {
  7.                 print $1, "\t", $2, "\n";
  8.         }
  9. }
復(fù)制代碼
123
返回列表 發(fā)新帖
您需要登錄后才可以回帖 登錄 | 注冊(cè)

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

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP