Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python RegEx Split

import re

# Splitting will occurs only once, at '05', returned list will have length 2
print(re.split('d+', 'On 05th Jan 1999, at 11:02 AM', 1))

# 'Boy' and 'boy' will be treated same when flags = re.IGNORECASE
print(re.split('[a-f]+', 'Aey, Boy oh boy, come here', flags=re.IGNORECASE))
print(re.split('[a-f]+', 'Aey, Boy oh boy, come here'))
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #RegEx #Split
ADD COMMENT
Topic
Name
3+6 =