Remove the empty lines and comment lines in the code, you can use the following regular expressions.

xiaoxiao2021-03-31  211

Remove the empty lines and comment lines in the code, you can use the following regular expressions.

Match space line

^ (/ t | / n |) * / N

Matching pure notes (if it is "/ *" comment, you need only rows including "/ *")

SP:

^ (| / t) * (- | //* ).*/ n

C #: ^ (| / t) * (// | //* ).*/ n

Matching code and annotation (同) mix line (including pure notes)

Sp: ^. * (- | //* ).*/ n

C #: ^. * (// | //* ).*/ n

usage:

In the Replacement dialog box, enter the above string. In line with the conditions of the lower left corner, select the regular expression (formal performance).

In addition, using the "|" symbols to match the various matches, the combination matching can be used:

Matching pure notes (same) and empty lines (after the matching line replace it, only the code line is left)

SP:

(^ (| / t) * (- | //* ).6/ n) | (^ (/ t | / n |) * / n)

C #: (^ (| / /) * (// | //* ).*/ n) | (^ (/ t | / n |) * / n)

转载请注明原文地址:https://www.9cbs.com/read-130960.html

New Post(0)