REX Question

Post Reply
gerry.odea
Posts: 96
Joined: Fri Sep 19, 2008 9:33 am

REX Question

Post by gerry.odea »

User avatar
Kai
Site Admin
Posts: 1263
Joined: Tue Apr 25, 2000 1:27 pm

REX Question

Post by Kai »

<rex ">>v\=\P=[^&;]*" $ShowURL>

would work. That will also skip any following query-string variables; e.g. for `www.youtube.com/watch?v=mj9ncegifsa&foo=bar' it would still pull out just the `v' value.

It works by looking for `v=' first (the `>>' anchor says start here first), then ignores that (the `\F'), then grabs all chars after that up until the next ampersand, semicolon, or end of string.
User avatar
Kai
Site Admin
Posts: 1263
Joined: Tue Apr 25, 2000 1:27 pm

REX Question

Post by Kai »

On second thought, a better version would be:

<rex ">>[?&]v\=\P=[^&;]*" $x>

which will ensure that it doesn't match on `xyz=...'.
Post Reply