Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
davidl.me
David's Wiki
Search
Search
Log in
Personal tools
Log in
Python: Difference between revisions
Page
Discussion
English
Read
View source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
View source
View history
General
Special pages
Printable version
← Older edit
Newer edit →
Python
(view source)
Revision as of 14:37, 15 April 2020
4 bytes removed
,
15 April 2020
→Regular Expressions (Regex)
Revision as of 12:42, 9 April 2020
(
view source
)
David
(
talk
|
contribs
)
(
→Usage
)
← Older edit
Revision as of 14:37, 15 April 2020
(
view source
)
David
(
talk
|
contribs
)
(
→Regular Expressions (Regex)
)
Newer edit →
Line 152:
Line 152:
import re
import re
myReg = re.compile(r'height:(\d+)cm')
myReg = re.compile(r'height:(\d+)cm')
myMatch =
re
.match(
myReg,
"height:33cm");
myMatch =
myReg
.match("height:33cm");
print(myMatch[1])
print(myMatch[1])
# 33
# 33
David
Bureaucrats
,
Interface administrators
,
Administrators
5,337
edits
Toggle limited content width