擅长:python、mysql、java
<p>如果有注释,这个正则表达式不会捕获行<code>(//, @*, /*, <!--)</code>否则它将捕获所有没有空格的内容,希望这能解决您的问题。你知道吗</p>
<pre><code>([\n]|^)(?P<group>(?! *\/\/| *@\*| *\/\*| *<!--| *\\\*)([^\n]*?)(\S)(((?! *\/\/| *@\*| *\/\*| *<!--| *\\\*).)*))
</code></pre>