On Sun, Jun 05, 2022 at 11:55:28PM +0000, goncholden via wrote:
> What would be the equivalent regex pattern that matches the pattern described
> by the following parameter expansions?
>
> fld="${flentry%[[:blank:]]*}"
This matches the shortest suffix string that starts with a blank (or,
the bit of the string from the last blank to the end).
[[:blank:]][^[:blank:]]*$
>
> fl="${flentry#*[[:blank:]]}"
The shortest prefix string that ends in a blank (or, the bit of the
string from the start to the first blank).
^[^[:blank:]]*[[:blank:]]
--
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden
.