Updated the regexes in the category table to be grouped in order to facilitate extraction of index numbers more easily.
Added function to figure out the next available number.

Signed-off-by: unknown <astring@astring-pc.aved.local>