This regex is an option: ':\s*(.+)'
In [7]: re.search(':\s*(.+)', 'Model Code: AAABBBCCCDDDEEE').group(1)
Out[7]: 'AAABBBCCCDDDEEE'
Regards
Rolando
On Sun, Mar 23, 2014 at 4:29 AM, BrendanB <[email protected]> wrote:
> Hi,
>
> I'm trying to use a regex to remove some characters from string. However
> I get an invalid syntax error when using in scrapy
>
> pl.add_xpath('price', '//*[@class="proText
> discount"][@itemprop="lowPrice"]', .re=r"^[^:]*:")
>
> The example string is
> Model Code: AAABBBCCCDDDEEE
>
> I would like to only return
> AAABBBCCCDDDEEE
>
> Any help would be appreciated
> Brendan
>
> --
> You received this message because you are subscribed to the Google Groups
> "scrapy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/scrapy-users.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.