在 Perl 中正規表示法的取代,可以簡單的利用 $1、$2 等方式來輕鬆指代記憶的群組;比如:
$text="Hypermethylation of E-cadherin is an independent predictor of improved survival in head and neck squamous cell carcinoma. Shematic illustration of E-cadherin in adherens junction. E-cadherin homodimer on the cytoplasmic membranes of adjacent cells is shown. Moreover, overexpression of E-cadherin, which was found underexpressed in MTX-resistant cells, also sensitized the cells toward the chemotherapeutic agent"; $text=~s/([^>])(\bE-cadherin\b)([^<])/$1$2<\/span>$3/g; print $text; # 輸出: Hypermethylation of E-cadherin is an independent predictor of improved survival in head and neck squamous cell carcinoma. Shematic illustration of E-cadherin in adherens junction. E-cadherin homodimer on the cytoplasmic membranes of adjacent cells is shown. Moreover, overexpression of E-cadherin, which was found underexpressed in MTX-resistant cells, also sensitized the cells toward the chemotherapeutic agent
在 C# 中,也可以辦到:
沒有留言:
張貼留言