Regular expression to find repetitions of arbitrary characters

Advertisements I have a large PHP codebase with many instances of this pattern: $result = $expression? $expression: $alternate; Which I want to replace with: $result = $expression ?: $alternate; Here $expression can be anything like $this->system->cache(‘1234′). It will usually start with $, and usually not have any spaces in it. Those few that don’t start… Read More Regular expression to find repetitions of arbitrary characters