I searched a text file for all lines containing the word velcro. I now want to print the contents of those lines, but only the parts that follow velcro
say I have a line of text
the purple monkey climbs the velcro cactus
How would I print everything that comes after velcro (looking for general answer)
I started out with:
c = /.*velcro.*/
if (line ==~ c){
println ...
}
Use a capturing group in your regular expression: