Is there a way using eregi_replace to replace all charecters that are NOT included in a set with something else.

For example, is there a way to replace all charecters in $var that are NOT [a-zA-Z0-9_\x7f-\xff] with "_"

So something like eregi_replace(![a-zA-Z0-9_\x7f-\xff], "_", $string) ...