Skip to content

Commit

Permalink
fix hyperlinks regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Jun 15, 2020
1 parent 212e1f3 commit d4da7b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions atsynedit/atsynedit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ TATCaretProps = class
cHintBookmarkDy = 16;
cUrlMarkerTag = -100;

cUrlRegex_Email = '\b\w[\w\-\.]*@\w[\w\-\.]*\.\w{2,}\b';
cUrlRegex_WebBegin = 'https?://|ftp://|mailto:|magnet:\?|www\.|ftp\.';
cUrlRegex_Web = '\b(' + cUrlRegex_WebBegin + ')\w[\w\.\-\/]*(\?[^<>''"\s]+)?'; //various chars allowed only after path+'?'
cUrlRegex_Email = '\b(mailto:)?\w[\w\-\.]*@\w[\w\-\.]*\.\w{2,}\b';
cUrlRegex_WebBegin = 'https?://|ftp://|magnet:\?|www\.|ftp\.';
cUrlRegex_Web = '\b(' + cUrlRegex_WebBegin + ')\w[\w\.\-\/]*(\?[^<>''"\s]+)?(\#\w*)?'; //various chars allowed only after path+'?'
cUrlRegexInitial = cUrlRegex_Email + '|' + cUrlRegex_Web;

cTextEditorLocked: string = 'Wait...';
Expand Down
8 changes: 5 additions & 3 deletions test_files/all.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Unicode sample:
Sample:
ΓΔΕΘΛΞ √∞∟∩∫
Ударе́ние
Links: http://yahoo.com www.yahoo.com [email protected]
Full-width: ああえ and ああえ, end

links http://dd.dd#page / www.dd.dd?(param)[param]
emails [email protected] / mailto:[email protected]

Jp full-width: ああえ, end
wwwwwwwwwwwwwwwwwwwwwwwww. wwwwwwww, wwwwwww; wwwww: ..test... www "www...", www,
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Expand Down

0 comments on commit d4da7b8

Please sign in to comment.