I have tried below one:
A=https://xyz.site
echo -e ${A//:*}
Result: https
Please describe me that, how this ${A//:*} term results https or http and what's the concept behind it, share a article or pdf if possible.
For Worldwide web [www]
Its preety simple to extract this one:
A=www.google.com
echo -e ${A::3}
Result: www
${parameter:offset:length}— This is referred to as Substring Expansion. In your example${A::3}means${A:0:3}and returns the first 3 characters of the variableA.${parameter/pattern/string}— This notation replaces the first match of pattern with a string. If pattern begins with/, all matches of pattern are replaced with string. In your example${A//:*}means${A//:*/}and it replaces all patterns:*with an empty string.