get "grep" matched string

hello everybody,
i want to use the matched string from grep command, because grep return the whole line, and i don't need it
how can this be done?

grep -o string file
1 Like