scholar icon indicating copy to clipboard operation
scholar copied to clipboard

Get scholar does not work for ids with punctuation

Open doomlab opened this issue 3 years ago • 0 comments

Because you do this: ids <- stringr::str_extract_all(string = aa, pattern = ";user=[[:alnum:]]+[[:punct:]]")

It will end the regex when it hits any punctuation. That does not work for ids with punctuation, like myself.

Instead do this because ids are 12 characters: ids <- stringr::str_extract_all(string = aa, pattern = ';user=.{12}')

And then to remove the user part: ids <- ids %>% unlist %>% gsub(";user=", "", .) %>% unique

doomlab avatar Feb 18 '22 19:02 doomlab