Re: Delimit URL end to space or newline
From: Gnarlodious (gnarlodious_at_yahoo.com)
Date: 03/27/05
- Next message: Ed Morton: "Re: Delimit URL end to space or newline"
- Previous message: Alan Connor: "Re: Delimit URL end to space or newline"
- In reply to: Ed Morton: "Re: Delimit URL end to space or newline"
- Next in thread: Alan Connor: "Re: Delimit URL end to space or newline"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 27 Mar 2005 15:08:53 GMT
Entity Ed Morton spoke thus:
>> Iım having a hard time delimiting the end of a URL, where it might end with
>> either a space or a newline:
> Instead of using ".*" as the last part of the pattern, specify you want
> a sequence of non-spaces:
Ah... so it reads the remainder of the string to a real-life delimiter.
> sed 's|\(http.*\..\{2,4\}/\)\([^[:space:]]*\)| <a
> href=\"\1\2\"target=\"_new\">\1</a>|'
I had not used a "character class" in OSX before but it does work. Very
cool.
> The [:space:] character class includes tabs, blanks and newlines (see
There's an erroneous dot and right parentheses at the end of that URL so it
didn't parse:
> <http://www.gnu.org/software/gawk/manual/gawk.html#table_002dchar_002dclasses>
Good info, thanks.
-- Gnarlie
"And those who were seen dancing were thought to be insane by those who
could not hear the music."--Nietzsche
- Next message: Ed Morton: "Re: Delimit URL end to space or newline"
- Previous message: Alan Connor: "Re: Delimit URL end to space or newline"
- In reply to: Ed Morton: "Re: Delimit URL end to space or newline"
- Next in thread: Alan Connor: "Re: Delimit URL end to space or newline"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|