explain the linux regex for getting filename

view story

http://stackoverflow.com – Can any guys kindly help me explain why getting filename using this way. for example: the file is: fileName = "/Users/test/am01/output/output.log" fileName=${fileName##*/} then we got fileName = output.log Could you guys help me explain what does ##* means, I'm so confused on this regex expression. Additionally, there is another example like this: filename="testdata.done" echo ${filename%.done} then we got test data What does % mean, I've never seen this regex expression. (HowTos)