給定一個url,以下正則表達式可以在URL中的某些點處插入/替換單詞。 代碼: #!/usr/bin/perl
use strict;
use warnings;
#use diagnostics;
my @insert_words = qw/HELLO GOODBYE/;
my $word = 0;
my $match;
while (<DATA>) {
chomp
有沒有辦法在組上進行替換? 說我想根據自定義格式在文本中插入鏈接。因此,鑑於這樣的事情: This is a random text. This should be a [[link somewhere]]. And some more text at the end.
我想 This is a random text. This should be a <a href="/link_some