Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
regex question
#7
Epilog.
It is very important for me to reduce processing time.
Even 10 or 20 % would save hours.
Some time ago I invested in a regex hardcopy book, but the effort/performance ratio leaves to be desired.
(I can understand that these are ideal exam questions.)
In all fairness : except for 1 statement I use a lot . I.e. replacing all but uppercase or digits in a string.
I cannot beat :
newstr= re.sub("[^A-Z0-9]", " ",oldstr)
On a million transactions it is marginally faster than any other replace I tried.
The jury is still out.
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
regex question - by DPaul - Jun-18-2022, 09:20 AM
RE: regex question - by snippsat - Jun-18-2022, 11:34 AM
RE: regex question - by DPaul - Jun-18-2022, 02:24 PM
RE: regex question - by snippsat - Jun-18-2022, 03:21 PM
RE: regex question - by DPaul - Jun-18-2022, 05:31 PM
RE: regex question - by DPaul - Jun-19-2022, 06:42 AM
RE: regex question - by DPaul - Jun-19-2022, 08:37 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020