package Ġorg . intellij . plugin . tracker . utils Ċ Ċ import Ġjava . util . regex . Pattern Ċ Ċ /** Ċ Ġ* ĠClass Ġcontaining Ġpatterns Ġneeded Ġfor Ġidentifying Ġlinks Ġbased Ġon Ġtheir Ġlink Ġpath Ġtype Ċ Ġ*/ Ċ enum Ġclass ĠLink Patterns ( val Ġpattern : ĠPattern ) Ġ{ ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠPattern Ġfor Ġa Ġweb - link Ġto Ġmultiple Ġlines Ġ( web - hosted Ġgit Ġrepositories ) ĊĠĠĠĠ Ġ*/ ĊĠĠĠ ĠWeb Link To Lines ( Pattern . compile (" (( https ? :// )| ( www . )) ([ a - zA - Z . ]+)/ ([ a - zA - Z 0 - 9 -_ ./ ]+)/ ([ a - zA - Z ]+ [ a - zA - Z 0 - 9 - _. ]+)/ (( blob / ([ a - z 0 - 9 ]+ )) | (- / blob ))/ ([ a - zA - Z 0 - 9 -_ ./ ]+) # L ([ 0 - 9 ]+ )- L ([ 0 - 9 ]+) ")), ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠPattern Ġfor Ġa Ġweb - link Ġto Ġa Ġsingle Ġline Ġ( web - hosted Ġgit Ġrepositories ) ĊĠĠĠĠ Ġ*/ ĊĠĠĠ ĠWeb Link To Line ( Pattern . compile (" (( https ? :// )| ( www \\. )) ([ a - zA - Z . ]+)/ ([ a - zA - Z 0 - 9 -_ ./ ]+)/ ([ a - zA - Z ]+ [ a - zA - Z 0 - 9 - _. ]+)/ (( blob / ([ a - z 0 - 9 ]+ )) | (- / blob ))/ ([ a - zA - Z 0 - 9 -_ ./ ]+) # L ([ 0 - 9 ]+) ")), ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠPattern Ġfor Ġa Ġweb - link Ġto Ġa Ġfile Ġ( web - hosted Ġgit Ġrepositories ) ĊĠĠĠĠ Ġ*/ ĊĠĠĠ ĠWeb Link ToFile ( Pattern . compile (" (( https ? :// )| ( www . )) ([ a - zA - Z . ]+)/ ([ a - zA - Z 0 - 9 -_ ./ ]+)/ ([ a - zA - Z ]+ [ a - zA - Z 0 - 9 - _. ]+)/ (( blob / ([ a - zA - Z - _. 0 - 9 ]+ )) | (- / blob / ([ a - zA - Z - _. 0 - 9 ]+ ))) / ([ a - zA - Z 0 - 9 -_ ./ ]+ \\ .[ a - zA - Z 0 - 9 -_ ./ ]+) ")), ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠPattern Ġfor Ġa Ġweb - link Ġto Ġa Ġdirectory Ġ( web - hosted Ġgit Ġrepositories ) ĊĠĠĠĠ Ġ*/ ĊĠĠĠ ĠWeb Link To Directory ( Pattern . compile (" (( https ? :// )| ( www . )) ([ a - zA - Z . ]+)/ ([ a - zA - Z 0 - 9 -_ ./ ]+)/ ([ a - zA - Z ]+ [ a - zA - Z 0 - 9 - _. ]+)/ (( tree / ([ a - zA - Z - _. 0 - 9 ]+ )) | (- / tree / ([ a - zA - Z - _. 0 - 9 ]+ ))) / ([ a - zA - Z 0 - 9 -_ ./ ]+) ")), ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠPattern Ġfor Ġa Ġgeneric Ġweb - link Ġ( not Ġa Ġlink Ġto Ġcode ) ĊĠĠĠĠ Ġ*/ ĊĠĠĠ ĠGeneric Web Links ( Pattern . compile (" https ? :// ( www \\. )? [- a - zA - Z 0 - 9 @ :% ._ + ~ # = ]{ 1 , 2 5 6 }\\ .[ a - zA - Z 0 - 9 ()] { 1 , 6 }\\ b ([- a - zA - Z 0 - 9 () @ :% _ + .~ # ?& // = ]*) ")), ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠPattern Ġfor Ġa Ġrelative Ġlink Ġto Ġmultiple Ġlines ĊĠĠĠĠ Ġ*/ ĊĠĠĠ ĠRelative Link To Lines ( Pattern . compile (" .* [^ \\\\ \\. \\/ \\ :\\ * \\ ? \\\" \\ < \\ > ]+ \\. [^ \\\\ \\. \\/ \\ :\\ * \\ ? \\\" \\ < \\ > ]+ # L ([ 0 - 9 ]+ )- L ([ 0 - 9 ]+ )\ $ ")), ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠPattern Ġfor Ġa Ġrelative Ġlink Ġto Ġa Ġsingle Ġline ĊĠĠĠĠ Ġ*/ ĊĠĠĠ ĠRelative Link To Line ( Pattern . compile (" .* [^ \\\\ \\. \\/ \\ :\\ * \\ ? \\\" \\ < \\ > ]+ \\. [^ \\\\ \\. \\/ \\ :\\ * \\ ? \\\" \\ < \\ > ]+ # L ([ 0 - 9 ]+ )\ $ ")), ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠPattern Ġfor Ġthe Ġgit Ġdiff Ġoutput Ġline Ġthat Ġcorresponds Ġto Ġthe Ġgit Ġh unk Ġinfo ĊĠĠĠĠ Ġ*/ ĊĠĠĠ ĠGit Diff Changed Lines ( Pattern . compile (" @@ Ġ- ([ 0 - 9 ]+ )((( ,) ([ 0 - 9 ]+ )) *) Ġ\ \+ ([ 0 - 9 ]+ )((( ,) ([ 0 - 9 ]+ )) *) ")) Ċ } Ċ