Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7738

Composing regex from a list

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From TheSaint <nobody@nowhere.net.no>
Newsgroups comp.lang.python
Subject Composing regex from a list
Followup-To comp.lang.python
Date Thu, 16 Jun 2011 20:48:46 +0800
Organization Aioe.org NNTP Server
Lines 11
Message-ID <itcu3f$b1k$1@speranza.aioe.org> (permalink)
NNTP-Posting-Host ecFDtfka4Xyf0mNcnbhS3Q.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Complaints-To abuse@aioe.org
User-Agent KNode/4.4.11
X-Notice Filtered by postfilter v. 0.8.2
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7738

Followups directed to: comp.lang.python

Show key headers only | View raw


Hello,
Is it possible to compile a regex by supplying a list?

lst= ['good', 'brilliant'. 'solid']

re.compile(r'^'(any_of_lst))

without to go into a *for* cicle?

-- 
goto /dev/null

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Composing regex from a list TheSaint <nobody@nowhere.net.no> - 2011-06-16 20:48 +0800
  Re: Composing regex from a list Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-16 13:09 +0000
    Re: Composing regex from a list TheSaint <nobody@nowhere.net.no> - 2011-06-17 19:45 +0800
  Re: Composing regex from a list Vlastimil Brom <vlastimil.brom@gmail.com> - 2011-06-16 15:25 +0200

csiph-web