4-5 定?符?

ɭԧڭ̤unrAPɤ]nҼ{rX{mAɴNnϥΩwICbqΦ̡A̱`ΪwŸNO ^ M $A䤤 ^ N@Ӧrꪺ}lmA] ^xy NuH xy }lrvF $ N@ӦrꪺmA] xy$ NuH xy rvCШUCdҡG

Example 1: 04-qιB⦡/regExp14.mstr1 = 'Chapter 5 is my favorite'; str2 = 'I like Chapter 2'; pat = '^Chapter'; fprintf('regexp(''%s'', ''%s'') = %d\n', str1, pat, regexp(str1, pat)); fprintf('regexp(''%s'', ''%s'') = %d\n', str2, pat, regexp(str2, pat));regexp('Chapter 5 is my favorite', '^Chapter') = 1 regexp('I like Chapter 2', '^Chapter') =

NĤ@令\A] Chapter Obrܼ str1 }lmAĤGNѤF]]Ǧ^Ӫůx}^A] Chapter Obrܼ str2}lmC

HUOwŸCPzG

νd藍ߤr
^xyH "xy" }lrAҦp "xyz", "xyab"]Yn ^AШϥ \^^"axy", "bxy"
xy$H "xy" rAҦp "axy", "abxy"]Yn $AШϥ \$^"xya", "xyb"

Hint
@b JavaScriptBVBScript UNIX ҨϥΪqΦA٥iH䴩t~ةwŸAOO \b M \BA䤤 \b iHrɡ]Word Boundary^A\BiHDrɡAOثeb MATLAB 7.x å䴩oөwŸC]Ui regExp15.m ӴլݬݡC^


MATLAB{]pGig