Hi there,,
hoping someone knows how to do this, i aint got a clue
if strfind say from text file and you have
$word$worda|wordb
now i can do this as strfind, but what i was is so you can
$word$wordagain$worda|wordb
and still do a seperate strfind on worda and wordb
any ideas?
maybe strfind(line,"^%$(%S+)%$(%S+)%$(%S+)|(%S+)$")
QuoteOriginally posted by c h i l l a
maybe strfind(line,"^%$(%S+)%$(%S+)%$(%S+)|(%S+)$")
dont quite sure what that does, dont understand it, i have to be able to grab worda, and wordb seperatly after checking the word or words inside the $$
I don't understand you Phatty correct.
you want "word" to be found twice in strfind ???
otherwise this is a simple solusion:
LINE: $word$worda|wordb
_,_,word1,word2,word3 = strfind(line, "$(%S+)$(%S+)|(%S+)$")
this should do the thing you want now you can
do a seperat strfind on each word after this if there is something speciall in it you want.
hmm no not what i mean, so
$therewordheretobefoundfirst$thenlatercatchthisword|andthisword
but so i can add
$word1$word2$andthenstillcatchonlythisone|andthisone
hmm ok. I think I need to leave this for Plop or any other.
If you don't want multi strfind's ex. one for 1:st word and the the other etc.
cause in don't know how to block $ if I end with it in strfind.
ex:
_,_,word1=strfind(line,"$(%S+)$") this in my eyes will grab first word.
but becouse of $ last it read from the back. one suggestion change $ to ex: # my solusion. much simpler for me helping you.. :-D
LINE: #word#worda|wordb
_,_,word1,word2,word3 = strfind(line, "#(%S+)#(%S+)|(%S+)$")
All three words is grabbed, to what you want with them.
with this you only grab word2 & word3
_,_,word1,word2,word3 = strfind(line, "#%S+#(%S+)|(%S+)$")
think I can't help you more... sry.
its ok i think i got it,
first of all do the strfind to get the first word in $ $ or whatever else is in there, then do another to skip them and go direcly to the others, i think i confused tho, ill be back soon if i cant do it eheh
you need gsub here.
try this for a hint.
data = "$hoi$dag$zwaai"
function TheFind(word)
if word == "zwaai" then
print(word)
end
end
tmp = gsub(data, "%$(%a+)", function(word) TheFind(word) end)
plop