@@ -64,7 +64,8 @@ classify_matches <- function(matches) {
6464 # # number <- as.numeric(str_match(match, "BLOCK\\((\\d+)\\)")[1, 2])
6565 if (grepl(" \\ ( *(\\ d+) *\\ )" ,match )){
6666 number <- # # as.numeric(
67- stri_match_all_regex(match , " BLOCK\\ s*\\ ( *(\\ d+) *\\ )" )[[1 ]][1 , 2 ]
67+ # # stri_match_all_regex(match, "BLOCK\\s*\\( *(\\d+) *\\)")[[1]][1, 2]
68+ regmatches(match , regexec(" BLOCK\\ s*\\ ( *(\\ d+) *\\ )" ,match )[[1 ]][2 ]
6869 # #)
6970 } else {
7071 number <- " 1"
@@ -85,7 +86,8 @@ classify_matches <- function(matches) {
8586 # # Split (ll,init,ul)
8687 # # nums <- as.numeric(str_match_all(match, "-?\\d+(\\.\\d+)?")[[1]][, 1])
8788 nums <- # # as.numeric(
88- stri_match_all_regex(match , pattern.singlenum )[[1 ]][, 1 ]
89+ # # stri_match_all_regex(match, pattern.singlenum)[[1]][, 1]
90+ regmatches(match , gregexpr(pattern.singlenum ,match ,perl = TRUE ))[[1 ]]
8991 # # )
9092 results <- append(results , list (list (
9193 string.elem = match ,
@@ -106,7 +108,8 @@ classify_matches <- function(matches) {
106108 # Split (ll,init)
107109 # # nums <- as.numeric(str_match_all(match, "-?\\d+(\\.\\d+)?")[[1]][, 1])
108110 nums <- # # as.numeric(
109- stri_match_all_regex(match , pattern.singlenum )[[1 ]][, 1 ]
111+ # # stri_match_all_regex(match, pattern.singlenum)[[1]][, 1]
112+ regmatches(match , gregexpr(pattern.singlenum ,match ,perl = TRUE ))[[1 ]]
110113 # # )
111114 results <- append(results , list (list (
112115 string.elem = match ,
@@ -122,7 +125,8 @@ classify_matches <- function(matches) {
122125 # Extract init from (init)
123126 # # nums <- as.numeric(str_match(match, "-?\\d+(\\.\\d+)?")[1, 1])
124127 nums <- # # as.numeric(
125- stri_match_all_regex(match , pattern.singlenum )[[1 ]][1 , 1 ]
128+ # # stri_match_all_regex(match, pattern.singlenum)[[1]][1, 1]
129+ regmatches(match , gregexpr(pattern.singlenum ,match ,perl = TRUE ))[[1 ]]
126130 # # )
127131 results <- append(results , list (list (
128132 string.elem = match ,
0 commit comments