Since you're talking about command line parameters why not just have the user pass each extension as it's own parameter ie: yourProgramName cpp h hpp? Then you won't need to separate the values since they're already separated.
Your program receives command line arguments. More than one argument?
How do you know which argument has the "regexp"?
Lets assume that you know. You have one argument. A C-string. A null-terminated char array. A word.
Is there any other valid prefix for that word than the \.(?
Is there any other valid suffix for that word than the )?
Between those parentheses is then a vertical bar-delimited list of subwords?
You can find the positions of the opening and closing parentheses, can't you?
You can create a string object from such sequence?
> cuz the project requirements
I would like to know the project requirements.
You don't properly describe your problem and you don't answer our questions.