I'm not exactly a regex guru, so I have some difficulty finding a regular expression for the following case.
I'd like to match a string of the form <prefix>$rolename$<suffix> (e.g. abc$rolename$def) that has a maximum length of 20. Both <prefix> and <suffix> can be empty and may contain any character. The $rolename$ part is required.
Shouldn't be difficult but I just can't figure out how to do this. Can anyone help me?