Guilherme's answer is partially correct: you do need to pass in a regular expression. There's another problem with your regex, though: your repetition (.* right before px) is greedy: it will match everything it can. So if you have height: 20px; whatever: 0px, it will greedily match 20px; whatever: 0px (see how it consumed everything up to the last px?). You will have to change it to a lazy match by appending the repetition with a ?:
string.replace( /height: .*?px;/, "height: 50px;" );
To make it more robust still, you might want to account for a variable amount of whitespace, or if the height occurs at the end of the string (which I use a lookahead for):
string.replace( /height:\s*\d+px(?=;|$)/, 'height: 50px' );
Note I also used a digit specifier (\d) instead of the wildcard metacharacter (.). Obviously this will only work if height will always be specified in integer units.