I am making a bot and I want the bot to keep track of group expenses. I need to be able to tell the bot about the amount that was paid and the participants (i.e. the list of people the user who's typing the input paid for). Participant must be sequences of exactly two letters taken from the uppercase latin alphabet (no digits or other symbols are allowed).
EXAMPLE: Say that I go out for lunch with my friends FH, GT, YU, WQ and CS. In order to tell the bot about our lunch together I will type the total amount that was paid, followed by '|', followed by the relevant people who took part in the event other than me (so FH, GT, YU, WQ, CS). If I want (this is not required though) I can also put a space after the list of names and write the name of the event: if present, the name of the event must always be enclosed in double quotes (").
For example, this is a valid input:
65|FH,GT,YU,WQ,CS "lunch out"
So the format is: number, |, names (separated by commas), space, name of the event. (The last two being optional).
The number must always be positive (for obvious reasons) and it can either be an integer (e.g. 65) or a decimal (e.g. 65.7, 65.32 etc). If the number is a decimal number, it may have at most 2 digits after the decimal point.
All of these are also valid inputs:
65|FH,GT,YU,WQ,CS
34.56|FH,GT "club night"
120.7|FH,GT,KM,LW,AS,XZ,PO "cinema tickets"
The same participant can't be mentioned more than once, so the following input is not valid.
65|FH,GT,YU,WQ,CS,GT
In short: the command should start with an amount followed by the separator |, followed by the list of people the user paid for. It's optional to insert a message that describes the expense.
There are infinitely many inputs that are valid. They would all be different but they all would follow the above rules (no participant is mentioned twice, each participant is separated by a comma, the amount is either an integer or a decimal with at most 2 digits after the decimal point, etc..).
However, I cannot seem to "capture" what they all share in common (their "format" that follows the rules I stated) so that the bot can distinguish valid inputs from invalid ones. I was thinking of using a regular expression. I am not very familiar with regular expressions but it seems to me that a regex could not capture all the possible forms the input can have (for example, the number of names, the number of decimal digits in the amount, the optional name for the event and so on)
How should I proceed?

^[\d.]+\|([A-Z]{2},)*([A-Z]{2})(?: "[\s\w]+")?$. This won't handle duplicate character groups but the RegEx gurus will probably also know of a way how to handle this. Here's a demo of the above query.^\d+(?:\.\d{1,2}){0,1}\|([A-Z]{2},)*([A-Z]{2})(?: "[\s\w]+")?$(also updated in the demo).