擅长:python、mysql、java
<p>那<code>\b(keyword)\n(\w+)\b</code>呢?你知道吗</p>
<pre><code>\b(keyword)\n(\w+)\b
\b get a word boundary
(keyword) capture keyword (replace with whatever you want)
\n match a newline
(\w+) capture some word characters, one or more
\b get a word boundary
</code></pre>
<p>因为<code>keyword</code>和<code>\w+</code>在捕获组中,您可以在以后的代码中根据需要引用它们。你知道吗</p>
<p><a href="https://regex101.com/r/XCiW1p/1" rel="nofollow noreferrer">Try it here!</a></p>