Re: newb question on strings

2008-06-27 Thread Kirk Strauser
At 2008-06-24T20:27:33Z, regex_jedi <[EMAIL PROTECTED]> writes: > Notice that the 4th value has a single quote in it. Well, I need to > make sure that the single quote is escaped before handing it off for > further processing to a class I later call for some other processing. Out of curiosity, wh

Re: newb question on strings

2008-06-25 Thread Cédric Lucantis
Le Tuesday 24 June 2008 22:27:33 regex_jedi, vous avez écrit : > ok, I have looked a lot of places, and can't seem to get a clear > answer... > > I have a string called >each_theme > > Some values of the string may contain a single quote as in - >Happy >Sad >Nice >Frank's Laundr

Re: newb question on strings

2008-06-25 Thread Bruno Desthuilliers
Dan Bishop a écrit : On Jun 24, 4:04 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Are you trying to escape for a regular expression? Just do re.escape(). print re.escape('Happy') Happy print re.escape("Frank's Diner") Frank\'s\ Diner If you're escaping for URLs, there's urllib2.quot

Re: newb question on strings

2008-06-24 Thread Dan Bishop
On Jun 24, 4:04 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Are you trying to escape for a regular expression? > > Just do re.escape(). > > >>> print re.escape('Happy') > Happy > >>> print re.escape("Frank's Diner") > > Frank\'s\ Diner > > If you're escaping for URLs, there's urllib2.quote

Re: newb question on strings

2008-06-24 Thread [EMAIL PROTECTED]
Are you trying to escape for a regular expression? Just do re.escape(). >>> print re.escape('Happy') Happy >>> print re.escape("Frank's Diner") Frank\'s\ Diner If you're escaping for URLs, there's urllib2.quote(), for a command line, use subprocess.list2cmdline. Generally, the module that consu

newb question on strings

2008-06-24 Thread regex_jedi
ok, I have looked a lot of places, and can't seem to get a clear answer... I have a string called each_theme Some values of the string may contain a single quote as in - Happy Sad Nice Frank's Laundry Explosion Notice that the 4th value has a single quote in it. Well, I need to