prman 13
regular exspression s .
a general porpose approch to developing and useing regexps.
1)
regular ezpessions , are sequnces of charters that form a string - called pattern .
readability is paramont.
2) break down a pattern into it’s constuent parts .
divide and concure.
3) I try to construct a # of patterns tyhat can be applied seqentally.
to the input text.
now inorder to set pattern with the conflict between TCL and prman code..
to fix this .
set pattern “([a-z])” “(\[a-z\])” NO
set pattern {([a-z])} YES
beak down
[a-z] these breakets signify a charter class
this is looking for any charter in the alebet from a-z that are lower case .
for al lower and puctuation .
[a-z:;,.]
all charter upperand lower,
[a-z A-Z]
for ccharters , upper lower numerals
[a-zA-Z0-9]
________________________
pattern that wil fin
537
or
.537
thats a charer class .
now those wil find te first letter or numeral . not awholeword .
to get a whole word you need an *
example: [a-z]*
{[\s]*} any # of spacs ..undifined space \s any thing inher is a space.
set SPACE {[\s]*} * match all spaces in a sequnce.
to find a rib statment
set STATEMENT {[\w]} \w finds a word .
to capture whats beinhg matched you use the () ex: {([\w])}
set statmentPattern $SPACE$STATEMENT$SPACE
string :=
[\s]*([\w]*)[\s]* same as the upper statement .
if this works it wil return a 1
horray it acctully works !
ok . have to make . :
set quoting . {( )}
set quotedpattern $Space$quoted$space