2014-10-15 正規表現の後方読み ruby regex Rubyにも、後方一致というオプションがついてます。 これを使うと、特定パターンに続く文字列を抽出する事が可能となります /(?<=<b>)\w+(?=<\/b>)/.match("Fortune favours the <b>bold</b>") # => #<MatchData "bold"> 参考もと 正規表現 ruby - Is there any way to shorten this regular expression? - Stack Overflow 正規表現の解説 上級編