Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #99219 > unrolled thread
| Started by | david burstein <david007killer@gmail.com> |
|---|---|
| First post | 2015-11-21 10:49 -0800 |
| Last post | 2015-11-21 19:20 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
using re.split function david burstein <david007killer@gmail.com> - 2015-11-21 10:49 -0800
Re: using re.split function MRAB <python@mrabarnett.plus.com> - 2015-11-21 19:20 +0000
| From | david burstein <david007killer@gmail.com> |
|---|---|
| Date | 2015-11-21 10:49 -0800 |
| Subject | using re.split function |
| Message-ID | <f810df9d-5691-467c-b212-7799dfdbb38d@googlegroups.com> |
im pretty new in python and i didnt get how to use the re.split function. for example if i have a string and i want to split it by two conditions: first one splitting when " [ " appears second one when "]" appears
[toc] | [next] | [standalone]
| From | MRAB <python@mrabarnett.plus.com> |
|---|---|
| Date | 2015-11-21 19:20 +0000 |
| Message-ID | <mailman.44.1448133667.2291.python-list@python.org> |
| In reply to | #99219 |
On 2015-11-21 18:49, david burstein wrote: > im pretty new in python and i didnt get how to use the re.split function. > for example if i have a string and i want to split it by two conditions: > first one splitting when " [ " appears second one when "]" appears > re.split(r" \[ |\]", string) You need to escape the "[" because it normally indicates the start of a character set.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web