I have a text like
details = "1. Command id = 22 Time = 2:30 <br> 2. Command id = 23 Time = 3:30"
Now I need to convert it into
"1. http://localhost:3000/command_id=22/home Time = 2:30 <br> 2. http://localhost:3000/command_id=23/home Time = 3:30"
I used regex and gsub but it will not do that as gsub will replace same string. Then there are some techniques using sed and awk.
To extract all ids like 22, 23, I used
details.scan(/Command id = [0-9]+/).join(",").scan(/[0-9]+/)
Any ideas how to do the above conversion?
Command id =from the string or extracting the ids or both?