str = "alpha beta gamma delta epsilon"
#      0....5....0....5....0....5....
#      (for your counting convenience)

pat = /(b[^ ]+ )(g[^ ]+ )(d[^ ]+ )/

# Three words, each one a single match
refs = pat.match(str)

# "beta "
p1 = refs.begin(1)         #6
p2 = refs.end(1)           # 11
# "gamma "
p3 = refs.begin(2)         # 11
p4 = refs.end(2)           # 17
# "delta "
p5 = refs.begin(3)         # 17
p6 = refs.end(3)           # 23
# "beta gamma delta"
p7 = refs.begin(0)         #6
p8 = refs.end(0)           # 23

