Python Forum
re.split multiple delimiters problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
re.split multiple delimiters problem
#1
I'm trying to split a long string using both a colon and new line as delimiters. It is splitting on the colon but not the new line. I guess I need some help on the proper syntax for the new line character. TIA
import re
   .
   .
   .
entities=re.split('\n |: ',result)
Reply


Messages In This Thread
re.split multiple delimiters problem - by gw1500se - Jun-23-2019, 03:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Delimiters - How to skip some html tags from being translate Melcu54 0 212 May-26-2021, 06:21 AM
Last Post: Melcu54
  Parse String between 2 Delimiters and add as single list items lastyle 5 431 Apr-11-2021, 11:03 PM
Last Post: lastyle
  Pandas: how to split one row of data to multiple rows and columns in Python GerardMoussendo 4 920 Feb-22-2021, 06:51 PM
Last Post: eddywinch82
  multiple condition if statement problem FelixReiter 3 462 Jan-11-2021, 08:07 AM
Last Post: FelixReiter
  Split string between two different delimiters, with exceptions DreamingInsanity 2 590 Aug-24-2020, 08:23 AM
Last Post: DreamingInsanity
  Python Hangman Game - Multiple Letters Problem t0rn 4 1,180 Jun-05-2020, 11:27 AM
Last Post: t0rn
  Split string with multiple delimiters and keep the string in "groups" DreamingInsanity 4 1,450 May-12-2020, 09:31 AM
Last Post: DeaD_EyE
  [split] Python Class Problem astral_travel 12 1,438 Apr-29-2020, 07:13 PM
Last Post: michael1789
  Problem with delimiters johnprada 5 958 Jan-29-2020, 10:17 AM
Last Post: DeaD_EyE
  Problem with delimiters johnprada 1 559 Jan-28-2020, 04:27 PM
Last Post: buran

Forum Jump:

User Panel Messages

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