On Monday, November 19, 2012,   wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am working on a cmd.Cmd-based program, and normally could just split the string and get the right parts.<br>

<br>
Now I have a case where I could have two or three words in the string that need to be grouped into the same thing.<br>
<br>
Then I realized that I'm not the only person who has had to deal with this, and I'm wondering if my solution is the best one out there or if this is as ugly at it feels?<br>
<br>
Code below<br>
.......<br>
<br>
#x('Seattle 456') -> ('Seattle', '456')<br>
#x('"Portland Alpha" 123') -> ('Portland Alpha', '123')<br>
#x("'Portland Beta' 789') -> ('Portland Beta', '789')<br><br></blockquote><div> <snipped code defining function x()></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

This seem really ugly. Is there a cleaner way to do this? Is there a keyword I could search by to find something nicer?<br>
</blockquote><div><br></div><div>Use the "shlex" module in the std lib?<span></span></div><div><br></div><div>Cheers,</div><div>Chris </div><br><br>-- <br>Cheers,<br>Chris<br>--<br><a href="http://rebertia.com" target="_blank">http://rebertia.com</a><br>