看板 Programming
作者 標題 perl 字串取代問題
時間 2014年04月16日 Wed. PM 11:22:36
我要用perl刪除<![ ]>內的東西
我現在用的語法是
$_ =~ s/<![^>]*>//g;
無法刪除,要怎麼修改才能將裡面內容完全刪除,有人能幫我嗎,感恩
以下為要取代的原始碼
<![CDATA[gdsid = 4262;gdstitle = "Oxidized low-density lipoprotein effect on LOX-1 overexpressing aortic endothelial cell line HAECT: time course";sample_ids = [329067,329072,329075,329058,329073,329107,329057,329085,329089,329076,329094,329105,329062,329079,329090,329066,329086,329099,329071,329078,329081,329096,329102,329104,329068,329074,329100,329059,329097,329098,329055,329103,329108,329061,329064,329065,329060,329063,329095,329070,329082,329092,329083,329101,329106,329087,329091,329093,329080,329084,329088,329056,329069,329077];sample_titles = ["LOX1 oxLDL 2hr 282295583","LOX1 oxLDL 2hr 282295563","LOX1 oxLDL 2hr 282295573","LOX1 oxLDL 6hr 282295703","LOX1 oxLDL 6hr 282295693","LOX1 oxLDL 6hr 282295683","LOX1 oxLDL 12hr 282295823","LOX1 oxLDL 12hr 282295813","LOX1 oxLDL 12hr 282295803","LOX1 oxLDL 24hr 282295943","LOX1 oxLDL 24hr 282295933","LOX1 oxLDL 24hr 282295923","LOX1 Untreated 2hr 282295553","LOX1 Untreated 2hr 282295533","LOX1 Untreated 2hr 282295543","LOX1 Untreated 6hr 282295673","LOX1 Untreated 6hr 282295663","LOX1 Untreated 6hr 282295653","LOX1 Untreated 12hr 282295783","LOX1 Untreated 12hr 282295773","LOX1 Untreated 12hr 282295793","LOX1 Untreated 24hr 282295903","LOX1 Untreated 24hr 282295893","LOX1 Untreated 24hr 282295913","LOX1 0hr 282295443","LOX1 0hr 282295463","LOX1 0hr 282295453","GFP oxLDL 2hr 282295513","GFP oxLDL 2hr 282295503","GFP oxLDL 2hr 282295523","GFP oxLDL 6hr 282295643","GFP oxLDL 6hr 282295633","GFP oxLDL 6hr 282295623","GFP oxLDL 12hr 282295753","GFP oxLDL 12hr 282295763","GFP oxLDL 12hr 282295743","GFP oxLDL 24hr 282295873","GFP oxLDL 24hr 282295863","GFP oxLDL 24hr 282295883","GFP Untreated 2hr 282295493","GFP Untreated 2hr 282295483","GFP Untreated 2hr 282295473","GFP Untreated 6hr 282295593","GFP Untreated 6hr 282295613","GFP Untreated 6hr 282295603","GFP Untreated 12hr 282295733","GFP Untreated 12hr 282295723","GFP Untreated 12hr 282295713","GFP Untreated 24hr 282295833","GFP Untreated 24hr 282295843","GFP Untreated 24hr 282295853","GFP 0hr 282295433","GFP 0hr 282295423","GFP 0hr 282295413"];factors = ["genotype/variation","agent","time"];subsets = ["LOX-1 overexpression","control","OxLDL ","untreated","control","0 hour","2 hour","6 hour","12 hour","24 hour"];subset_info = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,6,6,6,7,7,7,8,8,8,9,9,9,6,6,6,7,7,7,8,8,8,9,9,9,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9,6,6,6,7,7,7,8,8,8,9,9,9,5,5,5];]]>
--
※ 作者: jackox 時間: 2014-04-16 23:22:36
※ 看板: Programming 文章推薦值: 0 目前人氣: 0 累積人氣: 417
1樓 時間: 2014-05-31 03:31:33 (台灣)
→
05-31 03:31 TW
$_ =~ s/\<\!\[.*?\]\>//g; 不貪多取代 即會將最短的符合格式取代
回列表(←)
分享