Help with regex

已完成 已发布的 7 年前 货到付款
已完成 货到付款

Change the two reg_replace to one... and make it so it can work for unlimited chords.. Is this even possible?

//change [C] [C] [C]words to two bar chords and one chord

$html = preg_replace("@\[(".CHORDS.")\] \[(".CHORDS.")\] \[(".CHORDS.")\]([\wæøåÆØÅäÄöÖé])@", "<span class='bar'>$1</span><span class='bar'>$10</span><span class='chord'>$19</span>$28",$html);

//change [C] [C]words to one bar chord and one chord

$html = preg_replace("@\[(".CHORDS.")\] \[(".CHORDS.")\]([\wæøåÆØÅäÄöÖé\(])@", "<span class='bar'>$1</span><span class='chord'>$10</span>$19",$html);

PHP

项目ID: #10497888

关于项目

1个方案 远程项目 活跃的7 年前

授予:

dingyaosd

I'm not quite sure what you are achieving here, but You can use []+ to match 1 or more , or [](2,) that's 2 or more

$22 USD 在1天内
(2条评论)
0.0