in reply to Tk text widget indices.
Hrm, why arent you using regexes? I'm no master, but I think this will help:
m|\*\*(\w+)\b|g If you have all the text in a scalar, you can do this:
HTH
Update: explanation of regex
mhoward - at - hattmoward.org
m|\*\*(\w+)\b|g If you have all the text in a scalar, you can do this:
Is this what you want? Or was there some reason you're using TK's functions??while($text =~ m|\*\*(\w+)\b|g) { print "Found: " , $1 , "\n"; }
HTH
Update: explanation of regex
In case you're not familar with regexes, run this: perldoc perlretut :)m| \* #literal asterisk \* #ditto ( #start capture \w+ #one or more word characters aka [A-Za-z0-9_] ) #end capture \b #word boundary |gx #/x allows whitespace, /g makes it global (restart from last m +atch position in this case)
mhoward - at - hattmoward.org
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Tk text widget indices.
by perl_seeker (Scribe) on Jul 18, 2003 at 12:01 UTC |
In Section
Seekers of Perl Wisdom