Further to this, I am having trouble porting existing scripts to
bash-3.2's new style of regex matching.

Here is one example that is problematic: I want to use a character class
in my regex, but bash seems to get confused by the ':]]' closing the
class, and apparently takes it as a ']]' closing the conditional
expression.

Here is a distilled test case:

[[ $line =~ [[:space:]]*(a)?b ]] && echo match || echo no match

I used single quotes around the RHS in bash-3.1, which worked very well.
How should this be written so as to work with bash-3.2 -- and, of
course, still with bash-3.1?

Tim.
*/

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

_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to