i have full string like this:
Route::post('asdasdasdad/{param1}/{param2}', 'Admin\RouteController@a212e12e');
.
and want to delete that route so in preg_replace
i focus on
Route::post('asdasdasdad
as start text and
Admin\RouteController@a212e12e');
as last text.
here what i try
preg_replace("/Route::post('asdasdasdad\(.*Admin\RouteController@a212e12e');\s*/s", "", $string);
but its not working.
post(
- the brace at the end here is supposed to be a literal one, so that one would have to be escaped.asdasdasdad\(
- and here you are escaping it, meaning this demands a literal(
in that place, which isn’t present in your data.Route::post('asdasdasdad/{param1}/{param2}', 'Admin\RouteController@a212e12e');
.