ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Python Regex: How To Split a String On Multiple Characters

python split on multiple characters

python split

re.split

re.split()

python regex

python match

python text processing

python regular expressions

python re

python text data

text data

regular expressions

regex

text processing

python split strings

split string into words

split on multiple characters

split on many characters at the same time

string processnig

strings python

string to words

python extract words

list of words

bag of words

Автор: DataDaft

Загружено: 2020-10-01

Просмотров: 21008

Описание: ↓ Code Available Below! ↓

This video shows how to split a string of text based on multiple characters at the same time using the regular expressions package in Python. Splitting strings into parts, often into different words, is a common text processing operation but the base Python split function only splits on a single separator, so if your words are separated by several characters it might not get you what you need. The re.split() function allows you to split on a regular expression pattern, so you can split on multiple characters at the same time.

If you find this video useful, like, share and subscribe to support the channel!
► Subscribe: https://www.youtube.com/c/DataDaft?su...


Code used in this Python Code Clip:

import re

lines = '''Some-files_have+different.characters as|separators'''

Default python split works on a single character
lines.split()

Use re.split() to split on several different characters
re.split(pattern = r"[-_\|\.\+ ]",
string = lines)


Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .


⭐ Kite is a free AI-powered coding assistant that integrates with popular editors and IDEs to give you smart code completions and docs while you’re typing. It is a cool application of machine learning that can also help you code faster! Check it out here: https://www.kite.com/get-kite/?utm_me...

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Python Regex: How To Split a String On Multiple Characters

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Python Regex: How To Replace All Substrings In a String

Python Regex: How To Replace All Substrings In a String

Python Tutorial: re Module - How to Write and Match Regular Expressions (Regex)

Python Tutorial: re Module - How to Write and Match Regular Expressions (Regex)

Python for Data Analysis: Exploring and Cleaning Data

Python for Data Analysis: Exploring and Cleaning Data

Python  - Полный Курс по Python [15 ЧАСОВ]

Python - Полный Курс по Python [15 ЧАСОВ]

Regular Expressions in Python || Python Tutorial || Learn Python Programming

Regular Expressions in Python || Python Tutorial || Learn Python Programming

Пишем Микросервисы на Python + Брокер RabbitMQ

Пишем Микросервисы на Python + Брокер RabbitMQ

Python Программирование с Нуля! Полный Курс Python для Начинающих с нуля! [*12 часов из 41]

Python Программирование с Нуля! Полный Курс Python для Начинающих с нуля! [*12 часов из 41]

4 Hours Chopin for Studying, Concentration & Relaxation

4 Hours Chopin for Studying, Concentration & Relaxation

👩‍💻 Python for Beginners Tutorial

👩‍💻 Python for Beginners Tutorial

Python — полный курс для начинающих. Этот навык изменит твою жизнь.

Python — полный курс для начинающих. Этот навык изменит твою жизнь.

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]