看板 Perl 關於我們 聯絡資訊
  example: $string1 = "hello*world"; $string2 = "hello*world"; if ($string1 =~ /$string2/) 不成立  但是string1拿掉中間的「*」號,反而OK 請問要如何解決呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.229.171.217 ※ 編輯: Baternest 來自: 61.229.171.217 (05/15 14:55)
LiloHuang:]if ($string1 =~ /\Q$string2\E/) 05/15 16:14
Baternest:感謝指點 在文件中翻到\Q \E的用法了 05/15 19:50
audreytang:if (index($string1, $string2) >= 0) 亦可 05/16 01:04