Use regexp with capture groups in ash scripts

Hi all,

I'm wondering whether it's possible to make it possible in ash to use an html file as a source and use a regexp on it with capture groups and save the matched value(s) into a variable. Can you suggest ways to do this?

Cheers

Should be possible with sed:

title=$(wget -O - http://example.org/file.html | sed -rne 's#^.*<title>(.+)</title>.*$#\1#p')
echo "The title is $title"

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.