I'm using an addon for Firefox called redirector.
It automatically redirects to user defined urls on certain pages. It accepts both wildcards and regex.
One of the wildcard redirects I use is:
Include pattern: https://voe*.*/*
Redirect to: https://9xbuddy.org/process?url=https://voe.sx/$3
I'm trying to write a regex equivalent but I can't quite seem to get it right.
Any ideas please?
Writing a regex..
Writing a regex..
- Attachments
-
- Image 001.jpg (45.44 KiB) Viewed 10833 times
Re: Writing a regex..
For wildcards to regex, please try:
replacing * with .*
and replacing . with \.
https://voe.*\..*/.*
Looks like they support group captures too, so maybe something like:
https://voe.*\..*/(.*)
and then use \1 (or maybe they use $1?) in "Redirect to" to recall the text matched inside ()
replacing * with .*
and replacing . with \.
https://voe.*\..*/.*
Looks like they support group captures too, so maybe something like:
https://voe.*\..*/(.*)
and then use \1 (or maybe they use $1?) in "Redirect to" to recall the text matched inside ()
Re: Writing a regex..
Thanks so much, I think I've got it...
Include pattern: https://voe.*\..*/(.*)
Redirect to: https://9xbuddy.org/process?url=https://voe.sx/$1?
I'm afraid that regex makes my head spin :0)
Include pattern: https://voe.*\..*/(.*)
Redirect to: https://9xbuddy.org/process?url=https://voe.sx/$1?
I'm afraid that regex makes my head spin :0)
Re: Writing a regex..
If it helps, here's the translation from the globbing wildcards you're already familiar with to their regex equivalent.
You may also have to escape your slashes with backslashes in your filters for it to work.
Code: Select all
glob regex
wildchar: ? .
wildcard: * .*
period: . \.
stardotstar: *.* .*\..*
stardotexe: *.exe .*\.exe
backslash: \ \\
foreslash: / \/
colonbacksl: c:\ c:\\
slashslash: ftp:// ftp:\/\/
Re: Writing a regex..
Thanks a lot, that should help... The problem I was having was capturingthe characters at the end.
eg: https://voeun-block.net/qiqqffsxdtu5
The wildcard part was relatively easy to work out but I couldn't seem to get the qiqqffsxdtu5 part to appear, what I was getting was https://voe.sx/$1?, instead of https://voe.sx/qiqqffsxdtu5
The (.*) as suggested by void solved the problem.
eg: https://voeun-block.net/qiqqffsxdtu5
The wildcard part was relatively easy to work out but I couldn't seem to get the qiqqffsxdtu5 part to appear, what I was getting was https://voe.sx/$1?, instead of https://voe.sx/qiqqffsxdtu5
The (.*) as suggested by void solved the problem.