Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #99672
| Path | csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Rob Hills <rhills@medimorphosis.com.au> |
| Newsgroups | comp.lang.python |
| Subject | Re: Find relative url in mixed text/html |
| Date | Sun, 29 Nov 2015 01:44:58 +0800 |
| Lines | 32 |
| Message-ID | <mailman.191.1448732703.20593.python-list@python.org> (permalink) |
| References | <mailman.182.1448678122.20593.python-list@python.org> <n3bjmq$pdi$1@dont-email.me> |
| Reply-To | rhills@medimorphosis.com.au |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | news.uni-berlin.de QT3qbfh3xaFrXhueI5ZIGAQuVi0pAZoefNg+LOB4h/JA== |
| Return-Path | <rhills@medimorphosis.com.au> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.020 |
| X-Spam-Evidence | '*H*': 0.96; '*S*': 0.00; 'subject:text': 0.04; 'context': 0.05; 'bits': 0.07; 'mentioned,': 0.07; 'purpose.': 0.07; 'skip:/ 10': 0.07; '(those': 0.09; 'assume': 0.11; 'url:)': 0.14; 'hurts': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'tweak': 0.16; 'wrote:': 0.16; 'url:au': 0.18; 'working.': 0.18; 'meant': 0.22; 'cheers,': 0.22; 'header:In-Reply-To:1': 0.24; "i've": 0.25; 'header:User-Agent:1': 0.26; 'example': 0.26; 'figure': 0.27; 'converting': 0.27; 'btw,': 0.29; "i'm": 0.30; 'subject:/': 0.30; 'code': 0.30; 'relative': 0.30; 'regardless': 0.31; "can't": 0.32; 'extract': 0.33; 'instances': 0.33; 'skip:/ 20': 0.33; "i'll": 0.33; 'so,': 0.35; 'ones': 0.35; 'could': 0.35; 'fail': 0.35; 'urls': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'starting': 0.37; 'doing': 0.38; 'anything': 0.38; 'someone': 0.38; 'why': 0.39; 'sure': 0.39; 'enough': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'some': 0.40; 'your': 0.60; 'skip:u 10': 0.61; 'australia': 0.61; 'back': 0.62; 'charset:windows-1252': 0.62; 'safe': 0.63; 'skip:w 30': 0.64; 'goal': 0.64; 'brain': 0.66; 'here': 0.66; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'invitation': 0.80; 'url:asp': 0.80; 'appear,': 0.84; 'fortunately': 0.84; 'url:forums': 0.84; 'western': 0.89; 'hills': 0.93 |
| X-Enigmail-Draft-Status | N1110 |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
| In-Reply-To | <n3bjmq$pdi$1@dont-email.me> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:99672 |
Show key headers only | View raw
Hi Grobu, On 28/11/15 15:07, Grobu wrote: > Is it safe to assume that all the relative (cross) links take one of > the following forms? : > > http://www.aeva.asn.au/forums/forum_posts.asp > www.aeva.asn.au/forums/forum_posts.asp > /forums/forum_posts.asp > /forum_posts.asp (are you really sure about this one?) > > If so, and if your goal boils down to converting all instances of old > style URLs to new style ones regardless of the context where they > appear, why would a regex fail to meet your needs? I'm actually not discounting anything and as I mentioned, I've already used some regex to extract the properly-formed URLs (those starting with http://). I was fortunately able to find some example regex that I could figure out enough to tweak for my purpose. Unfortunately, my small brain hurts whenever I try and understand what a piece of regex is doing and I don't like having bits in my code that hurt my brain. BTW, that's not meant to be an invitation to someone to produce some regex for me, if I can't find any other way of doing it, I'll try and create my own regex and come back here if I can't get that working. Cheers, -- Rob Hills Waikiki, Western Australia
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Find relative url in mixed text/html Rob Hills <rhills@medimorphosis.com.au> - 2015-11-28 10:35 +0800
Re: Find relative url in mixed text/html Paul Rubin <no.email@nospam.invalid> - 2015-11-27 21:11 -0800
Re: Find relative url in mixed text/html Rob Hills <rhills@medimorphosis.com.au> - 2015-11-29 00:25 +0800
Re: Find relative url in mixed text/html Laura Creighton <lac@openend.se> - 2015-11-28 18:04 +0100
Re: Find relative url in mixed text/html Rob Hills <rhills@medimorphosis.com.au> - 2015-11-29 01:40 +0800
Re: Find relative url in mixed text/html Paul Rubin <no.email@nospam.invalid> - 2015-11-28 10:10 -0800
Re: Find relative url in mixed text/html Grobu <snailcoder@retrosite.invalid> - 2015-11-28 08:07 +0100
Re: Find relative url in mixed text/html Rob Hills <rhills@medimorphosis.com.au> - 2015-11-29 01:44 +0800
csiph-web