Python Forum
seeking simple|clean|pythonic way to capture {1,} numeric clusters
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
seeking simple|clean|pythonic way to capture {1,} numeric clusters
#7
Thanks, Gribouillis. At first glance that looks very elegant …

But:
  • The re.match that you provided catches the null case test_string = 'key_phrase []', that I did not want to catch?
  • I was thinking more along the lines of either editor.replace(…) or editor.search(…)?
Then again:
  • Given match == 22 1 333,
  • I could use local_arg = match_obj.group(1).split() in a handler-function,
  • before printing, listing or substituting?
  • and then, for replacing, re-string the substitution result(s) into a return_arg?
Reply


Messages In This Thread
RE: seeking simple|clean|pythonic way to capture {1,} numeric clusters - by NetPCDoc - Jun-10-2021, 05:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Seeking advice on dask distributed sawtooth500 4 232 Apr-15-2024, 11:07 PM
Last Post: sawtooth500
  Numeric Enigma Machine idev 9 483 Mar-29-2024, 06:15 PM
Last Post: idev
  Can i clean this code ? BSDevo 8 938 Oct-28-2023, 05:50 PM
Last Post: BSDevo
  Clean Up Script rotw121 2 1,006 May-25-2022, 03:24 PM
Last Post: rotw121
  How to clean UART string Joni_Engr 4 2,476 Dec-03-2021, 05:58 PM
Last Post: deanhystad
Question Numeric Anagrams - Count Occurances monty024 2 1,502 Nov-13-2021, 05:05 PM
Last Post: monty024
  How to get datetime from numeric format field klllmmm 3 1,999 Nov-06-2021, 03:26 PM
Last Post: snippsat
  Extract continuous numeric characters from a string in Python Robotguy 2 2,627 Jan-16-2021, 12:44 AM
Last Post: snippsat
  Clusters dawid294 6 2,351 Sep-17-2020, 02:18 PM
Last Post: Larz60+
  New user seeking help EdRaponi 2 43,302 Jun-23-2020, 12:03 PM
Last Post: EdRaponi

Forum Jump:

User Panel Messages

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