I'm quite confused about the following regular expressions I found in a shell script:
How do they work?
Those are not regular expressions, they are examples of Bash's parameter expansion: the substitution of a variable or a special parameter by its value. The Wooledge Wiki has a good explanation.
Basically, in the example you have,
for the variable $0, and the pattern '/', the two hashes mean from the beginning of the parameter, delete the longest (or greedy) match—up to and including the pattern.
See also the article on the Bash Hacker's Wiki.