Thank you,
can you please explain what is happening here please:
I mean why did you use space and plus sign ? Does it mean here:" one or more space " ?
Is there a possibility to use a "classic" regex as well ? I mean because purrr always was difficult for me to use. But of course it works here and thank you very much for the code.
That algorithm does not produce the results specified. On row 2 Diet Coke has Diet following the second space, but it is immediately followed by the third space so Coke won't be picked up. On row 13, pk Tonic is the result.
Leaving aside how, focus on what. Are AlumBottle, Sprite 4pk, Dt. Dr and 100% Vegetable actually the desired results, rather than Coca-Cola AlumBottle, Diet Coke AlumBottle, Coke Zero AlumBottle, Sprite AlumBottle, Dt. Dr Pepper and V8 100% Vegetable Juice?
If the universe of beverage names is known, a better approach would be the named entity routines in natural language processing packages.
but in spite of solution given up there on SO website:
`^(?:[^_]*_){2}([^_]*)`
it doesn't work as I expected. What should be a correct code to extract word U10 that is situated between second and third underscore ?
The author (Wiktor) of accepted code mentioned something about Group1 and Group2 . Maybe someone can explain it to me what is going on regarding that solution, please ?