bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to use [[ string =~ regexp ]]?


From: Peter Volkov
Subject: How to use [[ string =~ regexp ]]?
Date: Sun, 21 May 2006 22:13:49 +0400

Hello.

Please CC my email to answers as I'm not subscribed to the list.

I have problems using =~ operator. I've tried to search for answer, but
failed. I'm using GNU bash, version 3.1.17. Can anybody give me some
examples of usage?

I really do not understand why

$ [[ "string" =~ "[a-z]" ]] && echo something
something

echo me something. IIUC the regular expression [a-z] matches any single
letter, so how string "string" matches one letter?

Seems that I missed the point, or did I encounter bug?

Thank you for any help,
Peter.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]