in reply to Is there a better way to write this RegEx?

This captures a greedy block of non-], following a ] and some space, until the end of the line:

/\]\s*([^\]]+)$/