Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quick help with regular expressions
#6
Ah, didn't know about the buffers in the re.sub() function. No wonder why I couldn't make heads from tails on it. Devil's sub() function worked perfectly.

One question:

"(.*?)" <--- Isn't the *? redundant? Couldn't it just as well be "(.*)"? What am I missing here?

Also, Python's regex parser leans heavily on Perl. I wouldn't be surprised if Dusk's expression worked too.
Reply


Messages In This Thread
Quick help with regular expressions - by Fiel - 2009-07-06, 01:56 PM
Quick help with regular expressions - by Dusk - 2009-07-06, 02:25 PM
Quick help with regular expressions - by Stereo - 2009-07-06, 02:34 PM
Quick help with regular expressions - by Dusk - 2009-07-06, 02:39 PM
Quick help with regular expressions - by Nikkey - 2009-07-06, 02:45 PM
Quick help with regular expressions - by Fiel - 2009-07-06, 03:12 PM
Quick help with regular expressions - by Nikkey - 2009-07-06, 03:22 PM
Quick help with regular expressions - by Fiel - 2009-07-06, 03:45 PM
Quick help with regular expressions - by Stereo - 2009-07-07, 12:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)