No, regular expressions don't work for that. You have to implement some of the language semantics to be able to do it properly, and regular expressions are well-known to not be powerful enough to handle those kinds of interrelationships in text.
Consider potential false positives like "x = x + 1", or "x = y" if y hasn't been initialized yet -- for every read of the variable, you have to be able to statically prove that it had to have been initialized with an expression that was, itself, composed of only constants, already-initialized variables, and operators.
Functions make it worse. A function call could potentially modify global variables, so that means any function that refers to the variable you're trying to analyze would then need to have every one of ITS call sites analyzed to make sure it was never called before the variable was initialized. Conditionals also add complications if only one branch writes to the variable.
The safest approach would be to default to generating initializations for everything, then walk the block stacks and only remove the variables that are initialized to literals. This is simple (though still not something you can do with a regexp) but it would only remove the simplest cases of redundant assignments. That's why I say it's harder than it's worth -- the safe, easy approach isn't going to solve the full depth of the problem, and the more thorough way is ridiculously difficult.
/s/ Adam