On Mon, Sep 12, 2016 at 7:38 PM bruce <badouglas@xxxxxxxxx> wrote:
thanksAny help/pointers/thoughts..I can remove the beginning portion, but can't figureout the rest of the regex to remove the subsequent chars..trying to get the internal sub-string "78236"Got a basic string..Hey.Simple question.
http://venturacollege.bncollege.com/webapp/wcs/stores/servlet/BNCBHomePage?storeId=78236&campusId=78236&userId=-1002&catalogId=10001&ddkey=http:BNCBMultiCampusPageCmd
awk -F': ' '{print $2}' | tail -1 | sed 's/.*storeId=\(.*\).&/\1/'
Assuming $x contains the string, you can do this with pure bash:
if [[ $x =~ storeId=([^&]*) ]]; then echo "${BASH_REMATCH[1]}"; fi
or with sed:
echo $x | sed -e 's/.*storeId=\([^&]*\).*/\1/'
-- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://lists.fedoraproject.org/admin/lists/users@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org