Ruby 正则
(?=re) matches re at this point but does not consume it - you can look
forward for the context of a match without affecting $&.
str ="red, white, and blue"
p str.scan(/[a-z]+(?=,)/)
the result is :
=> ["red","white"]
(?=re) matches re at this point but does not consume it - you can look
forward for the context of a match without affecting $&.
str ="red, white, and blue"
p str.scan(/[a-z]+(?=,)/)
the result is :
=> ["red","white"]
暂无评论。
评论功能维护中,当前仅展示历史评论。