[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to match regex in bash? (any character)
From: |
Peng Yu |
Subject: |
How to match regex in bash? (any character) |
Date: |
Mon, 26 Sep 2011 20:19:27 -0500 |
Hi,
I know that I should use =~ to match regex (bash version 4).
However, the man page is not very clear. I don't find how to match
(matching any single character). For example, the following regex
doesn't match xxxxtxt. Does anybody know how to match any character
(should be '.' in perl) in bash.
[[ "$1" =~ "xxx.txt" ]]
--
Regards,
Peng
- How to match regex in bash? (any character),
Peng Yu <=