LPIC-1 Study Guide SYBEX

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

LPIC-1 Study Guide SYBEX

文章 yehlu »

https://red.anillosur.net/file/download/255586

代碼: 選擇全部

echo 'abcccccc' | grep -E '^abc{3,5}'
echo 'abcccccc' | grep  '^abc\{3,5\}'
echo  '192.168.1.1' | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: LPIC-1 Study Guide SYBEX

文章 yehlu »

IP Address Regular Expression Pattern

^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.
([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$
Description

^ #start of the line
( # start of group #1
[01]?\\d\\d? # Can be one or two digits. If three digits appear, it must start either 0 or 1
# e.g ([0-9], [0-9][0-9],[0-1][0-9][0-9])
| # ...or
2[0-4]\\d # start with 2, follow by 0-4 and end with any digit (2[0-4][0-9])
| # ...or
25[0-5] # start with 2, follow by 5 and ends with 0-5 (25[0-5])
) # end of group #2
\. # follow by a dot "."
.... # repeat with 3 times (3x)
$ #end of the line
Whole combination means, digit from 0 to 255 and follow by a dot “.”, repeat 4 time and ending with no dot “.” Valid IP address format is “0-255.0-255.0-255.0-255″.
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: LPIC-1 Study Guide SYBEX

文章 yehlu »

台灣POSTCODE 3 或 5 碼數字

代碼: 選擇全部

echo '1234' | grep -E '\<[0-9]{3}([0-9]{2}$)\>'
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: LPIC-1 Study Guide SYBEX

文章 yehlu »

找出最後一天的日期

代碼: 選擇全部

 cal | xargs | awk '{print $NF}'
回覆文章

回到「Linux」