Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python regex group

>>> p = re.compile('(a(b)c)d')
>>> m = p.match('abcd')
>>> m.group(0)
'abcd'
>>> m.group(1)
'abc'
>>> m.group(2)
'b'
Comment

python named group regex example

>>> re.search(r'(?P<name>[^-]+)-(?P<ver>d.d.d-d+).tar.gz', 'package_name-1.2.3-2004.tar.gz').groupdict()
{'name': 'package_name', 'ver': '1.2.3-2004'}
Comment

PREVIOUS NEXT
Code Example
Python :: get column pandas 
Python :: git help 
Python :: python replace two spaces with one 
Python :: python how to make multiple box plots 
Python :: multiple boxplots python 
Python :: Python How To Check Operating System 
Python :: remove element from dictionary python 
Python :: how to have requirement file in python for libs 
Python :: __new__ python 
Python :: how to redirect to previous page in django 
Python :: python find string 
Python :: how to give bar plot groupby python different colors 
Python :: python partial 
Python :: apply a created function pandas 
Python :: try except python not working 
Python :: python input integer only 
Python :: showing specific columns pandas 
Python :: tuple plot python 
Python :: how to make lists in python 
Python :: python zip folder 
Python :: pandas remove leading trailing spaces in dataframe 
Python :: excute a command using py in cmd 
Python :: install a lower version of python using conda 
Python :: python read scv 
Python :: Convert two lists into a dictionary in python 
Python :: python create path 
Python :: how to extract words from string in python 
Python :: different states of a button tkinter 
Python :: python print value and variable name 
Python :: check if file is txt python 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =