Python Forum
splitting or parsing control characters
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
splitting or parsing control characters
#18
You should take care of eventual empty strings when processing text starting/ending with seperator(s), for example for string from post #1.

Beside that I think we can agree that both re.split() with simple pattern and additional processing or re.findall() with more complicated pattern and less additional processing (or even without any processing with "big" pattern) works.

Personally I consider code with re.findall() from post #4 slightly more readable than additional processing after split, but thats just subjective opinion ...
Reply


Messages In This Thread
RE: splitting or parsing control characters - by zivoni - May-26-2017, 06:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Remove escape characters / Unicode characters from string DreamingInsanity 5 13,982 May-15-2020, 01:37 PM
Last Post: snippsat
  splitting on 2 or more possible characters Skaperen 6 3,619 Sep-03-2018, 04:10 AM
Last Post: perfringo
  splitting a string by 2 characters Skaperen 8 9,010 Dec-27-2016, 06:14 AM
Last Post: wavic

Forum Jump:

User Panel Messages

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