4-2 ?用式??本??

ڭ̥iHϥ regexp OrA]NOXY@ӯSwArbt@ӦrꪺX{mAoOqΦ̰򥻥ΪkCҦpApGnXulovevb@ӦruLove me tender, love me sweet, never let me govX{mAiΤUC{XG

Example 1: 04-qιB⦡/regExp01.mstring = 'Love me tender, love me sweet, never let me go'; pattern = 'love'; startIndex = regexp(string, pattern)startIndex = 17

^ǵGNulovevb string ܼƩҥX{mO 17C]Ъ`NAjpgOI^

Yniujpgiv]Ignore Cases^AhiHϥ regexpi OAҦpG

Example 2: 04-qιB⦡/regExp02.mstring = 'Love me tender, love me sweet, never let me go'; pattern = 'love'; startIndex = regexpi(string, pattern)startIndex = 1 17

^ǵGNuLovevMulovevb string ܼƩҥX{mOO 1 M 17C

Hint
Ҧϥ regexp dҡAiHN regexpiAHiujpgivC

YnXrX{}lMmAiHbϥ regexp ɡAh[@ӿXܼơAҦpG

Example 3: 04-qιB⦡/regExp03.mstring = 'Love me tender, love me sweet, never let me go'; pattern = 'me'; [start, finish] = regexp(string, pattern)start = 6 22 42 finish = 7 23 43

䤤 start M finish NҤ쪺Tӡumev}lMmC

bWzXӽdҤApattern ܼƳOѤ@rҺcAҥH\M findstr O\A]Lk{qιB⦡_\ġCbHUU`Aڭ̦b pattern ܼƤ[JWr]Metacharacters^ANiHݥXqΦqsjC


MATLAB{]pGig