AppleScript名:1D Listから条件抽出(正規表現1) |
— Created 2017-11-03 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" –http://piyocast.com/as/archives/4949 property NSPredicate : a reference to current application’s NSPredicate property NSArray : a reference to current application’s NSArray set aList to {"TATACCATGGGCCATCATCATCATCATCATCATCATCATCATCACAG", "CGGGATCCCTATCAAGGCACCTCTTCG", "CATGCCATGGATACCAACGAGTCCGAAC", "CAT", "CATCATCATGTCT", "DOG"} set anArray to NSArray’s arrayWithArray:aList set aPred to NSPredicate’s predicateWithFormat:"SELF MATCHES ’.*(CAT){3,}(?!CA).*’" set bRes to (anArray’s filteredArrayUsingPredicate:aPred) as list –> {"CATCATCATGTCT"} |
More from my site
(Visited 20 times, 1 visits today)