Quantcast
Channel: Unix Superhero
Viewing all articles
Browse latest Browse all 44

sed regex – grouping and optional matchers

$
0
0

escape parens for a group

escaped curlies with a range of {0,1} for optional stuff

 

not_in_master() {
 git log --oneline --decorate --left-right head...master | grep '^<' | sed 's/^..[^[:space:]]*[[:space:]]*\(([^)]*) \)\{0,1\}//'
 # sed regex ... escaped parens are groups, the escaped curlies are repeat ranges. basically my (or sed's) version of an optional atom

cat <<ZERO >/dev/null
❯ glmerge master
< 6ee92f0 (HEAD, origin/feature/preferences, feature/preferences) add/sort by position on preference groups/options
< a956d8a populate images and preference options for Makeup and Workout services
< e9e37cf update Hard Wax PrefOpt logo; use I18n when asserting not_authed error
ZERO
}

other stuff goes here



Viewing all articles
Browse latest Browse all 44

Latest Images

Trending Articles





Latest Images