W3C home > Mailing lists > Public > public-cwm-talk@w3.org > April to June 2007

Re: Decomposing a URI into its components

From: Dan Connolly <connolly@w3.org>
Date: Mon, 14 May 2007 08:13:08 -0600
Message-ID: <46486E74.6060904@w3.org>
To: Andrea Perego <andrea.perego@uninsubria.it>
Cc: Public CWM <public-cwm-talk@w3.org>

Andrea Perego wrote:
> Thanks. Yes, this is what I did. However, I had to specify one rule for
> each URI component:
> [...]
> Can this be obtained in a simpler way?

Yes; try str:search . The tests and documentation for it
are not all in place, but it works:

class BI_search(LightBuiltIn, Function):
     """a more powerful built-in for scraping using regexps.
     takes a list of 2 strings; the first is the
     input data, and the second is a regex with one or more () group.
     Returns the list of data matched by the () groups.


-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
Received on Monday, 14 May 2007 14:13:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:11:02 GMT