-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathregex.R
54 lines (53 loc) · 2 KB
/
regex.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Kaiaulu - https://github.com/sailuh/kaiaulu
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
regex_git_blame_commit_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^([a-f0-9]{40}) (\\d+) (\\d+)")
}
regex_git_blame_author_name_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^author (.*)")
}
regex_git_blame_author_email_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^author-mail (.*)")
}
regex_git_blame_author_time_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^author-time (.*)")
}
regex_git_blame_author_tz_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^author-tz (.*)")
}
regex_git_blame_committer_name_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^committer (.*)")
}
regex_git_blame_committer_email_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^committer-mail (.*)")
}
regex_git_blame_committer_time_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^committer-time (.*)")
}
regex_git_blame_committer_tz_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^committer-tz (.*)")
}
regex_git_blame_summary_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^summary (.*)")
}
regex_git_blame_previous_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^previous ([a-f0-9]{40}) (.*)")
}
regex_git_blame_filename_line <- function(lines_content){
stri_match_first_regex(lines_content,
"^filename (.*)")
}