Because picture (or example) is worth more than thousand words, I'll use an example:
RewriteRule ^/products/([0-9]+)$ /content.php?id=$1
In this RewriteRule example we've got simple regular expression. $1 is a reference to something that is captured by ([0-9]+), so it is reference to some number if the matching exists. Is it possible to do something like that in grep?
Let's say, some xml document contains the following :
<someTag>someValue</someTag>
I would like to extract only someValue, but input for second_bash_script for the following:
first_bash_script | grep "<someTag>\([[:digit::]]\)\+</someTag>" | second_bash_script
is someValue. Is it possible to extract only someValue using grep?
Thanks for any clue!