擅长:python、mysql、java
<p>在<a href="https://docs.python.org/2/library/re.html" rel="nofollow noreferrer">manual</a>函数中回复sub具体描述如下:</p>
<pre><code>Return the string obtained by replacing the leftmost non-overlapping occurrences of
pattern in string by the replacement repl.
</code></pre>
<p>在正则表达式中,第一个<code>.*</code>与字符串中<code>href</code>之前的所有内容匹配。那么字符串中<code>"css/login.css"</code>之前的所有内容都是您用正则表达式指定的模式的一部分。
然后将其替换为<code>***"css/login.css"**</code>。你知道吗</p>