'Visual Code Function "Insert Between Code" ? Is this exist?

anyone of you coder know about a extension like this?

For example: I have this code multiplied for 100

plan: <?= $this->user->plan_id ?>,
trial: <?= $this->user->plan_trial_done ?>,
email: "<?= $this->user->email ?>",

I need to replace $this->user->plan_id to isset($this->user->plan_id) ? $this->user->plan_id : ""

For example a tool if i select this code: isset({X}) ? {X} : "" Automaticaly replace all {X} with the previously selected code?



Solution 1:[1]

Perform a Regex Find-Replace

Find: (\$this->user->\w+)

Replace: isset($1) ? $1 : ""

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rioV8