On Wednesday, March 13, 2013 05:21:56 PM Peng Yu wrote:
> Hi,
>
> ${parameter%word} remove matching suffix pattern. I need something
> extract only the matching suffix which is to be not available
> according to bash manual. Do I miss anything?
>
Combining them is the only way.
~ $ ( getSuffix(){ echo "${1#"${1%%$2}"}"; }; getSuffix 'aaabbb' 'b?[^a]' )
bbb
OFC there are other Bashism methods. This is about the best with a PE.
--
Dan Douglas