move url_regex to a header

This commit is contained in:
Daniel Micay 2012-07-20 11:32:15 -04:00
parent 8200137f5d
commit e7acfc1635
2 changed files with 6 additions and 3 deletions

View File

@ -9,10 +9,9 @@
#include <vte/vte.h> #include <vte/vte.h>
#include <vte/vteaccess.h> #include <vte/vteaccess.h>
#define CSI "\x1b[" #include "url_regex.h"
// http://blog.dieweltistgarnichtso.net/constructing-a-regular-expression-that-matches-uris #define CSI "\x1b["
static const char * const url_regex = R"XXX(((?<=\()[A-Za-z][A-Za-z0-9\+\.\-]*:([A-Za-z0-9\.\-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+(?=\)))|([A-Za-z][A-Za-z0-9\+\.\-]*:([A-Za-z0-9\.\-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+))XXX";
enum class overlay_mode { enum class overlay_mode {
hidden, hidden,

4
url_regex.h Normal file
View File

@ -0,0 +1,4 @@
#ifndef URL_REGEX
#define URL_REGEX
const char * const url_regex = R"XXX(((?<=\()[A-Za-z][A-Za-z0-9\+\.\-]*:([A-Za-z0-9\.\-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+(?=\)))|([A-Za-z][A-Za-z0-9\+\.\-]*:([A-Za-z0-9\.\-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+))XXX";
#endif