I am trying to extract 22 chocolates from the following string:
SOMETEXT for 2 FFXX. Another 22 chocolates & 45 chamkila.
using regex \\d+\\s*(chocolates.|chocolate.). I used :
grep("\\d+\\s*(chocolates.|chocolate.)",s)
but it does not give the string 22 chocolates. How could I extract the part that is matching the regex?