How to scan the command line for an item link with spaces
Hello there.
I am nearly finished with my addon "restack" but now I have a little problem with scanning the command line. I use a function GetCmd() from somewhere, but that one splits arguments when there is a space in the line. So when I get a line with a link in it that has space, it breaks. What I want to have is a function that does the following: cmdline = "a test" -> returns "a","test" cmdline = "4231:0:0...[name with spaces] 3" -> returns "4231:0:0...[name with spaces]","3" I know there must be a very easy regex for this, if I only would be better in this. :-) Pls help. Regards Thomas |
why cant you have each word(characters seperated by space) returned seperatly?
what are you trying to do I guess you could do local thiscommandarray =GetCommand() for key, value in thiscommandarray do if(not thiscommandstring)and (value) then thiscommandstring = value end elseif(thiscommandstring) and (value) then thiscommandstring = thiscommandstring.." "..value end end DEFAULT_CHAT_FRAME:AddMessage(thiscommandstring) that should do what you want...dunno if its the best way though |
see which pattern match comes first.
Code:
function parseCommand( cmdLine ) |
All times are GMT -6. The time now is 02:03 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI