[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
regex capturing the left-hand side of =
From: |
Peng Yu |
Subject: |
regex capturing the left-hand side of = |
Date: |
Sat, 10 Jul 2021 07:07:50 -0500 |
Hi,
I want to capture the left-hand side of =.
Since bash variables can be at the left-hand side of =, it is easy to
be captured this case by a regex like ^[A-Za-z_][A-Za-z0-9_]$.
But it is not easy to capture assignments to elements in arrays or
associative arrays due to the complexity in the suffixes in between
[].
Is there a regex that can capture and only capture all bash code
snippets for the left-hand side of the assignment operator =?
--
Regards,
Peng
- regex capturing the left-hand side of =,
Peng Yu <=
Re: regex capturing the left-hand side of =, Koichi Murase, 2021/07/11