Match two comments and the content between them, how to write the rule?

/*start*/
import "aaa";
/*end*/

let a={
    b: c
    /*start*/
    d: e
    /*end*/
}

now you want to match all the content from / * start*/ to / * end*/ , and replace it with ",
, that is, all that"s left in the above code is:

.
let a={
    b: c
}

how to write the rule? there are spaces and carriage returns in the main.


/\/\*start\*\/[\s\S]*?\/\*end\*\//g

/\ /\ * start\ *\ / (. |\ n) *?\ /\ * end\ * / g

Menu