Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Any regular expressions gurus here?
#2
How about this one?
I'm not sure how Python does regexps. This should be suitable for Perl-alikes.

s/([KR])[^P]/\1,/


If I got the memory part of the replacement expression wrong, you can do it in two passes with

s/K[^P]/K,/

s/R[^P]/R,/
Reply


Messages In This Thread
Any regular expressions gurus here? - by volcs0 - 12-29-2008, 08:24 AM
Re: Any regular expressions gurus here? - by TheTominator - 12-29-2008, 02:32 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)