CCS下makefile的编写Word格式文档下载.docx
- 文档编号:20072640
- 上传时间:2023-01-16
- 格式:DOCX
- 页数:8
- 大小:20.23KB
CCS下makefile的编写Word格式文档下载.docx
《CCS下makefile的编写Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《CCS下makefile的编写Word格式文档下载.docx(8页珍藏版)》请在冰豆网上搜索。
.
BeginningandEndingofLine
^PUBLIC:
一行开头是PUBLIC。
\)$:
一行结尾是圆括号。
^\)$这一行就只有一个圆括号。
CharacterClasses
[AEIOUYaeiouy]:
matchesanyvowel,whetherupperorlowercase.
[0-9]willmatchanycharacterbetween0and9.
^如果不用在开头字母上,放中间表示itjustaddstheup-carettothatclass.Youmayuseitasashorthandmethodofsaying"
matchanycharactersexceptforthefollowing:
ratherthanspecifyingalargecharacterclass.Forexample,[^$.|(){}*+?
^]matchesanythingexcepttheelevencharactersfollowingtheup-caret.
EscapeSequences转义字符
EscapeMeaning
\nNewline(<
CR>
<
LF>
or<
dependingonhowitisdefinedforthedocument)
\tTab
\b[Ctrl]-[H](backspace)
\rCarriagereturn
\fformfeed
\nnnOctalvaluebetween0and0377.
\xnnHexadecimaldigitbetween0x00and0xFF
\mTheliteralcharacterm.
Note:
WhenusingescapesequencesinClanguagesourcecode,eachbackslashmustalsobeescapedwithanotherbackslash.Theresultingpatternspecificationisoftenunaesthetic.
IterationQualifiers
the*matchesanynumberofoccurrences,the+matchesoneormore,andthe?
matcheszeroorone.
特例:
\t*Theexampleabovewillmatchanynumberofconsecutivetabs,includingnone.Byitself,itisnotveryusefultomatchnoneofsomething.Aspartofalargerregularexpression,itcouldbequiteuseful.Forourpurposeshere,thefollowingmightbepreferable:
\t+Thisexamplematchesoneormoreconsecutivetabs.Thetabisrepresentedas\t,andtheplussignsays"
oneormoreoftheprevious."
Tomatchwhitespace,weneedtomatchspacestoo.Wedon'
tknowwhatorderthespacesandtabswillcomein,andwedon'
tknowhowmanytherewillbe.Thesearesignsthatweneedacharacterclass.
[\t]+Theexampleaboveusesacharacterclasscontainingaspaceandatab.The+signfollowingitmeansthatthisRegularExpressionwillmatchanycombinationofspacesandtabs,solongasthereisatleastonespaceortab.Ifyouwantedtomatchthewhitespacewithinafunctioncall,whereyouknewtheremightbeonespaceortab,ortheremightbenone,yourexpressioncouldlooklikethis:
\([\t]?
Thisexamplesearchesforaleftparenthesisfollowedbyzerooronespacesortabs.Sincetheleftparenthesisisameta-characteritisnecessarytoescapeorquoteitwithaprecedingbackslash.The\twehaveusedbeforetorepresentatabcharacter.Thequestionmarksays"
zerooroneofthepreceding."
MatchingaCharacter
Thebasicunitofaregularexpressionismatchingasinglecharacter.Youcanmatchasinglecharacterinoneofthreeways:
Literally,
Ambiguously,or
WithaCharacterClass.
Youmaymatchacharacterliterallybyusingthecharacteritselfortheappropriateescapesequence.Ifmatchingacharacterliterallyistoolimiting,youmaymatchambiguously,byusingthedot(.)metacharacter.Ifaliteralcharacteristoonarrowamatchandthedotistoobroadamatch,acharacterclasscanbeusedforanythinginbetween.
PlacingtheCursor
Theescapesequencethatspecifiescursorpositionis\c.Anexampleofitsusefollows:
singletons\[\c.*\]
Thisexampleplacesthecursoratthebeginningofwhatevertextiscontainedbetweentheleftandrightsquarebrackets.Thesquarebracketsaremetacharactersandarethereforeescaped.Thiscursorpositioningfacilitateseditingthecontentsofthesquarebrackets.
ReferenceGroupsandReplacementStrings
RegexExamples
RegularExpressionsTips
RegularExpressionSyntax
CharacterDescription
\Marksthenextcharacterasspecial.Todefineaspecialcharacterinaregularexpression,precedethespecialcharacterwiththebackslashcharacter.
Example:
Theregularexpression/n/matchesthecharactern.Theregularexpression/\n/matchesalinefeedornewlinecharacter.
^Matchesthebeginningofinputorline.Inthisimplementation,thischaractercannotbedefinedincharacterset.
$Matchestheendofinputorline.Inthisimplementationthischaractercannotbedefinedinacharacterset.
*Matchestheprecedingcharacterzeroormoretimes.Inthisimplementationcannotbedefinedifonlyonecharacterisspecifiedintheregularexpression.Thatmeansthat/zo*/matcheszandzoo,but/z*/willmatchnothingbecauseonlyonecharacterhasbeenspecified.
+Matchestheprecedingcharacteroneormoretimes.
?
Matchestheprecedingcharacterzerooronetime.Inthisimplementationcannotbedefinedifonlyonecharacterisspecifiedintheregularexpression.
.Matchesanysinglecharacterexcept'
\n'
.
(pattern)Matchesthepatternandremembersthematch.Thematchedsubstringcanberetrievedbyusing'
\0'
-'
\9'
intheregularexpression,where'
0'
9'
arethenumbersofthepattern.
Regularexpression'
(re).*\0s+ion'
willmatch'
regularexpression'
.First,thepattern?
re)?
matchesthefirsttwolettersof憆egularexpression?
andthepatternisrememberedwithindex0.Thepattern'
*'
matches'
gularexp'
in'
.Thepattern慭0?
retrievesthepatternthathasbeenrememberedwithindex0,andthis'
re'
matchesthesecondoccurrenceof'
.Finally,thepattern'
s+ion'
ssion'
x|yMatcheseitherthecharacter'
x'
or'
y'
.Youcancombinemorethantwocharacters.Example:
'
x|y|z'
{n}Meanstheprecedingcharacterwillmatchexactlyntimes(nonnegative).
{n,}Meanstheprecedingcharacterwillmatchatleastntimes(nonnegative).
{n,m}Meanstheprecedingcharacterwillmatchatleastntimesandatmostmtimes(bothnonnegative).
[xyz]Acharacterset.Matchesanyoneoftheenclosedcharacters.
[^xyz]Anon-matchingcharacterset.Matchesanycharacterthatisnotintheset.
\bMatchesawordboundary,thatis,theboundarybetweenanycharacterexcludingspacecharacters("
\f\n\r\t\v"
)andnon-spacecharacters.
\BMatchesanon-wordboundary.Matchesanyboundarybetweenspacecharactersorbetweennon-spacecharacters.
\dMatchesanydigit/0-9/
\DMatchesanynon-digit.
\eMarksthestartpositionoftexttoextract;
usedinconjunctionwith\E.
\EMarkstheendpositionoftexttoextract;
usedinconjunctionwith\e.Ifthe\Eisnotsupplied,theendofline($)willbeusedastheendposition.
\fMatchesaformfeed.
\nMatchesanewlinecharacter.
\rMatchesacarridgereturncharacter.
\sMatchesanywhitespacecharacter.
\SMatchesanynon-whitespacecharacter.
\tMatchesatabcharacter.
\vMatchesanyverticaltabcharacter.
\wMatchesanywordcharacterincludingunderscore.[A-Za-z0-9_]
\WMatchesanynon-wordcharacter(anycharacterthatdoesnotmatch\w).
\numWherenumisavaluebetween0and9.Matchesrememberedpattern.(Seedescriptionofpattern.)
/n/Wherenisavaluebetween1and255.MatchessuppliedinnASCIIcode.
Examples
"
FIND\e.+"
Matches"
FIND.+"
butonlyreturnsthecharactersafter"
FIND"
Find\e.+\ETheRest"
Find.+TheRest"
butonlyreturnsthecharactersbetween"
Find"
and"
TheRest"
^SOURCE=\e.+$"
ExtractsallsourcefilesaftertheSOURCE=macrodefinition.
^.+\.obj\s*:
\e.+$"
Extractsallthesourcedependenciesinamakefile.
^\w+s*=\e.+$"
Extractsallmacrodefinitions.
Searchingforcontrolcharacters(binary/hexdata)
Controlcharacterscanbeusedinbothsearchandreplacementpatterns.Anybytevaluecanbespecifiedaspartofapattern.Performthefollowingstepstosearchfororreplacebinaryorhexvalues.
1.GotoEdit郌ind(orFind/Replace,FindinFiles,ReplaceinFiles).
2.TurnonRegularExpressionsintheappropriatedialog.
3.Thenusethe\xnotationtospecifyhexadecimalvalues.
Examples:
Tosearchfortheformfeedcharacter,usethisstring:
\x0c
(That'
sbackslashxzeroc.)
Makesuretherearetwodigitsfollowingthex.
Tosearchfortwoconsecutivebytesbyhexadecimalvalue,stringthemtogetherlikethis:
\x0c\x0d
IfyouarereplacingEOLcharacters,thefollowinginformationwillhelptounderstandhowCodeWrightviewsanddealswithEndofLinecharacters.
Generally,using'
formatchingorreplacinglineendsisthesuggestedmethodinCodeWright(the'
\'
mustbedoubledwhenusedincode).However,aspecialcaseismadeforsearchingforandreplacinghexadecimal0Dand0Acharacters.Sincethesecharactersmakeupendsoflines,someruleshadtobeestablishedtoavoiddisruptingpartialline-endsequenceswhensearchingforandreplacingthem.Whensearchingfor0Dand0Ahexcharacters,keepthefollowinginmind:
穃x0awillmatchasolo(withoutapreceding0x0D)0x0Abutnotthepair.
穃x0dwillmatchasolo(withoutafollowing0x0A)0x0Dbutnotthepair.
\nwillmatchasolo0x0Aora0x0D,0x0Apair.
Replacing"
\x0d"
with"
\n"
wouldbegoodforconvertingaMacintoshfile(openedwithautodetectfiletypeoff).
isagoodwaytoconvertUnixfilestoMS-DOSfilesorvice-versa,ifthebufferflagforUnixEOLsissetappropriatelyinOptions郋ditor|郘anguage郞ptions.
SeeHexModeformoreinformationonhexediting.
SpecialCharacters
CharacterMeaning
.Matchesanysinglecharacter,exceptanewline
*Matchesanynumberofoccurrences(evenzero)oftheexpressionthatprecedesit.
+Matchesoneormoreoccurrencesoftheprecedingexpression.
Matcheszerooroneoccurrenceoftheprecedingexpression.
[and]Definesthebeginningandendofacharacterclass.
(and)Definesthebeginningandendofagroupofexpre
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CCS makefile 编写
![提示](https://static.bdocx.com/images/bang_tan.gif)