regex problem with webcheck
R Kimber
richardkimber at btinternet.com
Sun Jul 19 15:15:13 UTC 2009
On Sun, 19 Jul 2009 16:27:58 +0200
Siggy Brentrup wrote:
> > I've come to the conclusion that metacharacters don't work and that only
> > the simplest regular expressions (literal strings) actually work.
>
> It seems to me that you get bitten by the shell mangling your
> arguments, don't worry that still happens to me after decades. If I
> want to see what the invoked program sees, I use the attached trivial
> little python script.
>
> % ~/scripts/show_args.py webcheck \ \\\ "$SHELL" "$SHELL" '$SHELL'
> argv[1:] = ['webcheck', ' \\ /usr/bin/zsh', '/usr/bin/zsh', '$SHELL']
Thanks. That produced some interesting results.
Firstly, the example I quoted earlier, ^/.*, is seen by the shell as
exactly that, which raises the question of whether it's the right regex, or
whether I'm right that webcheck doesn't interpret metacharacters, despite
implying that it does. If the former, I'd be very grateful for a pointer as
to what the correct regex might be for any url that begins with /
I experimented with other examples, eg /\w+ with interesting results:
--yank=\/\w+ shows up as --yank=/w+, as one might expect
--yank=\/\\w+ show up as --yank=/\\w+, and
--yank=\/\\\w+ shows up as --yank=/\\w+
Hmmmnn.
I'd really like to get this working, so any suggestions will be gratefully
received.
- Richard
--
Richard Kimber
http://www.psr.keele.ac.uk/
More information about the ubuntu-users
mailing list