I have this string :
use A\B\C;
use A\B\C;
var $foo;
/*
* comment
*/
use D\E\F;
Class Foo {
How i can replace the last string that beginning with use. In example above must be "use D\E\F;" as the result.
I have found many ways but no luck. including with lookahead negative (?!) but was confused how to use it. So this the i can get now " use(.*); " but this was replaced all the matched string.
Thanks.