Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Filtering texts within brackets
#python 3.5.2 import re s = "<h1>Hello [Programmer], you are [Excellent]</h1>" g = re.finditer("\[\w+\]", s) l = list() # or, l = [] for m in g: text = m.group(0) l.append(text[1: -1]) print(l)
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Add missing names
variables.py
p1
shuru11
1
MBTI test ITA
linked_lists_2
15
Distance between latititude and longitude
Python_Hello_World
Please log in to post a comment.