regex - Groups using regular expression in Bash on windows -
here trying do:
message=“time-1 time-2 test" echo $message | sed -e 's/(^([a-z]{2,8}-[0-9]{1,4}).*[[:space:]]+[[:alnum:]]+$).*$/\2/‘
gives: time-1
should give: time-1 time-2
i need working on windows, linux , macos (as part of git hook), cannot use “=~"
can please correct wrong at.
i believe ask:
$ echo "$message" | sed -e 's/(^([a-z]{2,8}-[0-9]{1,4}[[:space:]]+)*).*/\1/' time-1 time-2
Comments
Post a Comment