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

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -