-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
preg_replace('/a(foo)bar/i', '$<caret>', $var);
preg_replace('/a(foo)bar/i', '\<caret>', $var);
preg_replace_callback('/a(foo)bar/i', function ($matches) {
return $matches[<caret>];
}, $var);
preg_replace_callback('/a(?<named>foo)bar/i', function ($matches) {
return $matches['<caret>'];
}, $var);
preg_replace_callback('/a(foo)bar/i', function ($matches) {
return $<caret> // lists all possible $matches[x] as variable with type text 'string'
}, $var);Completion popup should show the regex part from brackets ((foo) in above example) as tail text.
If the first function parameter is a variable (like $fooRegex), field ($this->fooRegex) or constant (FOO_REGEX), it should also take that declaration into account.
Reference:
https://www.php.net/manual/de/function.preg-replace.php
Metadata
Metadata
Assignees
Labels
No labels