skip to main
|
skip to sidebar
Thought Home of Mr.Solo
Monday, November 22, 2010
bash中使用if语句判断字符串是否匹配正则表达式
if [[ $var =~ 正则表达式 ]]; then
echo 'find it'
fi
需要注意的是
1.两个[]
2.=~前后都有空格
3.正则表达式形式省略了//
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Blog Archive
►
2014
(1)
►
February
(1)
►
2013
(1)
►
July
(1)
►
2012
(2)
►
August
(1)
►
February
(1)
►
2011
(5)
►
November
(2)
►
May
(1)
►
April
(1)
►
January
(1)
▼
2010
(4)
▼
November
(3)
Go Language - 函数格式
vim配置
bash中使用if语句判断字符串是否匹配正则表达式
►
January
(1)
►
2008
(4)
►
September
(1)
►
August
(3)
About Me
Mr.Solo
View my complete profile
No comments:
Post a Comment