Regex Problem.
#1

First of all sorry if wrong section :P

I want to edit some huge amount of stuff in my gamemode, So I made a regex replace.
Regex code:
Код:
PlayerInfo\[(.*?)\]\[(pVeh|vModel|vX|vY|vZ|vA|vC1|vC2|vPJ|vLocked)\]
And replace with:
Код:
PlayerVehicleInfo[$1][0][$2]
What is intentended here is to replace all: PlayerInfo[*][pVeh or anything else in brackets] to PlayerVehicleInfo[*][0][The var that was found written.]

And actually here is what happened when running that regex:

NOTE, RED is the 1st group matches.
Quote:

PlayerInfo[dfd][pstorgae] PlayerInfo[pid][pVeh] PlayerInfo[paa][vY]

PlayerInfo[paas][vY]

So as you can see, if there is one that doesn't have any of the keywords, pVeh... etc
It just selects till the next ] that has the keyword after it...

If anyone can fix it to me or just provide me a better one :P will be appreciated.
Will REP too.
Reply
#2

Ok, I fixed it... nvm :P
This was a fast help thread...

I used this btw:
Код:
PlayerInfo\[([a-zA-Z]*)\]\[(pVeh|vModel|vX|vY|vZ|vA|vC1|vC2|vPJ|vLocked)\]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)