Repeat in regex is easy. From "man grep":
Repetition
A regular expression may be followed by one of several repetition operators:
? The preceding item is optional and matched at most once.
* The preceding item will be matched zero or more times.
+ The preceding item will be matched one or more times.
{n} The preceding item is matched exactly n times.
{n,} The preceding item is matched n or more times.
{,m} The preceding item is matched at most m times. This is a GNU extension.
{n,m} The preceding item is matched at least n times, but not more than m times.
So a snippet of
\*{18,27}
would match any string of 18 to 27 asterisks, no more, no less.
Mark II:
You mention you're using bash, so I presume you have access to sed.
You should be able to put together a short sed script. (Pick a trivial example from any tutorial or man and massage it.)
The guts of it would be something like:
s|^\(/\*{72}\)\*+$|\1|
~~~~~
Pulling it apart:
s is regex substitution command
I'm using the pipe | as delimiter to avoid slashes fore and back
The regex:
^ start anchor
\( \) to isolate a subexpression for later (numbered capture) ~~~~~
/ a slash
\*{72} 72 asterisks (or as many as you want to keep)
\*+ one or more extra asterisks (will be removed)
$ end of line
The replacement
\1 the first matched subexpression ( / and 72 *'s )
I'll leave it to you to write the one for ****/
You can put both of them in the same script and it will just fly through your files.