From 41f38997544f957f89c992f427836ffd9c0a8d5a Mon Sep 17 00:00:00 2001 From: pcnick Date: Sun, 5 Dec 2021 14:24:06 +0800 Subject: [PATCH] Get-NameRegex: Publish NameRegex v0.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 發佈 0.1.0 * 使用 RegEx TAG 進行比對,將結果以 TAG 為 Key 值,回傳 Hash 物件 * 以比對到的 TAG 為錨點,對字串進行分割並放入 Hash,以便後續比對 * -Regex: 可以 Array 傳入多個比對式,回傳適當結果 * -Exclude: 對比到的結果進行排除,直到比對不成功 * -End: 結尾模式,僅輸出符合 TAG 的 Hash 物件 --- NameRegex.psd1 | Bin 0 -> 4572 bytes NameRegex.psm1 | 32 +++----------------------------- 2 files changed, 3 insertions(+), 29 deletions(-) create mode 100644 NameRegex.psd1 diff --git a/NameRegex.psd1 b/NameRegex.psd1 new file mode 100644 index 0000000000000000000000000000000000000000..c88caf6a03eeefe7168f4ef27ce46cd7582215be GIT binary patch literal 4572 zcmb_gU2IcT96v0XV`FnZCSJUweCGBA2f5-QbtU$gB0<8NPG2+e+he1D0@=i6rf81b<1^jk}+v*brh-*o(OI zVr+)*3B=usuOuyPlV#GIOIzYQLY~RXV?w)D>mg{4LplOW(Si*VYlgOF#9FGcCGe*& zmsVI0bFc&OECL^eWTIeoKQs-)qki?9SM^+jJTWNWe}t1@s7quT)WlF$DU(e%X2k%L>DjE)?%id{E+RgW4-sMz77?6#q31c@d93DZMTPRj+WEo z%DJs|gYk(+gX9hAi9tgg`47RXWWgr`5WEe)BvMO}-Hb0nQ=7LoRKNH%zivH}V!Xy) zH@MASWzx6a=Ka=p!TP>^0oeVF44z#e%KD_}uJqpypd&ravkEY#?RCyah+xEjX@Rt({(8SxxoPK-M6MKJ3qX2ije z3L}52O#VTOZG7mx@E!iEqX8AwtBu0`o(pCz@!F6jAQ-3#@@8nFj0JFCuD|jqB%ZkS z$yr0{VxHyya&=85`ffWEaLazy1vaJiuv&kGrb_&h+#x*coqQx2KJgNFQS@j(|Nv|8TF*x9nSd>qHfQeea=P2G zLK3hy48|RTMPiOhEf`!UoVOg+U>}OX$f?4ji=G>xtcniUiaZwa<d;zyV~A!*Q#~gbIi^OodV4Q~8$B!8>rfFgjJ26WHY>N8ou(RI ziYdA~jg}G|=xH_b8sED|JGt0h{QTM%aWSI1tUs-6;=}+juHA8zuX=X+qDL@Oi{l>9 zv|wxWRGBWt;)(Mf7D`wxfrW|s#jE*6`$?-IwIgRpxsL9)JL3}C7$5h|Z9tDB4?BSRsJfcu{)OT^fE{B@&1tcpZeOx9Sn8z$j-ho- zd$c6*w>p1Iwdr}TwI*s_sn?PhL}v1*#{!gzLqHGp?|yY%QqBHrCbrlcoU4tWbm&Fh zu5v~{yjzWj)O8%Fm%^^h%tj?r&Cu#o&kV%4#IAyW_4BZt55*pzu)oHAeahfseDtkO zPWvmdD(KWv*K2@7(|P zBj?E{%@>wC`IN72kaE$B`gGmzW^$f<(tN5jp){(lh+Z{6!q!#|Ur7o16qeSyE#XeS z53KoV=KJwVtchL80PNBJ<6*4*!oyQCw)L*P$1AaR5LW0k`Y?86L-#V(*Aeo5Hgmez4|5_x~bLud(_9F)W5)HI^wP?*0{txgkfsL!5 literal 0 HcmV?d00001 diff --git a/NameRegex.psm1 b/NameRegex.psm1 index d609753..81ca2a8 100644 --- a/NameRegex.psm1 +++ b/NameRegex.psm1 @@ -47,32 +47,6 @@ $Regex | % { @{ Target = $Str; Regex = $_; } } | &$InnerScrip } -$Pathes = @( - "L:\Anime\201110 WORKING’!!\[#CHAT RUMBLE#][WORKING’!!][01-13 END][BIG5][x264_aac][1280x720]\[#CHAT RUMBLE#][WORKING’!!][13][BIG5][x264_aac][1280x720][11C6E807].mp4" - "L:\Anime\200910 にゃんこい!(貓願三角戀)\[DMG][Nyan Koi!][01-12 END][848x480][BIG5]\[DMG][Nyan Koi!][12 end][848x480][BIG5].rmvb" - "L:\Anime\200910 聖剣の刀鍛冶(聖劍鍛造師)\[DMG][The Sacred Blacksmith][01-12 END][848x480][BIG5]\[DMG][The Sacred Blacksmith][04V2][848x480][BIG5].rmvb" - "L:\Anime\201104 星空へ架かる橋(架向星空之橋)\[AngelSub][Hoshizora e Kakaru Hashi][BDRip][Vol.01][1920x1080][TW_BIG5][x264_FLAC]\[AngelSub][Hoshizora e Kakaru Hashi][BDRip][01][1920x1080][BIG5][x264_FLAC].mkv" - "H:\Anime\201901 盾の勇者の成り上がり\[LKSUB][Tate no Yuusha no Nariagari][01-25][GB][720P][MP4]\[LKSUB][Tate no Yuusha no Nariagari][01][GB][720P].mp4" - "L:\Anime\202004 ストライク・ザ・ブラッド OVA IV\[Suzu-Kaze][Strike_the_Blood_IV_OVA][01-12FIN][BDRip_1080P][HEVC_YUV420P10]\[Suzu-Kaze] Strike the Blood IV 12FIN [BDRip 1920x1080 HEVC YUV420P10 FLAC].mkv" - "L:\Anime\200910 アスラクライン II(機巧魔神)\[DMG][Asura Cryin2][01-13 END][848x480][BIG5][RMVB]\[DMG][Asura Cryin 2][01][848x480][Big5].rmvb" - "H:\Data\Downloads\異世界食堂\[Lilith-Raws] Isekai Shokudou S02 - 06 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4].mp4" -) -$TestName = @($Pathes | % {$_.Split("\\")[-1]}) - -$Str = $TestName[3] -$Regex = @( - "S\d{2}[\s\-]+E?(?\d{2})" - "[\[\b\s](?\d{2})[\s_]?(?:[vV]\d|END|FIN)[\]\b\s]" - "\[(?\d{1,2})\]" - #"\d" -) - -$RS1 = $TestName | % { Get-NameRegex $_ -Regex $Regex } -$RS1 - -$NameRegex = @( - "[\[\b\s](?[^\[\]]*)[\]\b\s]?$" -) - -$RS1 | % { Get-NameRegex $_["L"] -Regex $NameRegex -Exclude "(BD|DVD|HDTV)RIP" -End } -$TestName | % { Get-NameRegex $_ -Regex $Regex } | % { $(Get-NameRegex $_["L"] -Regex $NameRegex -Exclude "(BD|DVD|HDTV)RIP" -End) + $_ } \ No newline at end of file +# Example +# $RS1 | % { Get-NameRegex $_["L"] -Regex $NameRegex -Exclude "(BD|DVD|HDTV)RIP" -End } +# $TestName | % { Get-NameRegex $_ -Regex $Regex } | % { $(Get-NameRegex $_["L"] -Regex $NameRegex -Exclude "(BD|DVD|HDTV)RIP" -End) + $_ } \ No newline at end of file