I'm trying to extract every character following a specific string. I can get this to work on regular expression testers such as Pythex (if there's a good regex expression tester for R, let me know).
I'm trying to get every character after "100" in the following string:
\nDec\n\n\n\n\n\n\n8238\n\n\n\n \n \n\n1st \n\n\n100\n\n\n\n\n\n\n\n10.40\n (1.5) \n\n\n\n1st\n\n\nLJ\n\n\n\n\n\n\n\n7.47m\n (1.4) \n \n\n24' 6.25\"\n\n\n\n\n3rd\n\n\nSP\n\n\n\n\n\n\n\n14.41m\n \n \n\n47' 3.5\"\n\n\n\n\n2nd\n\n\nHJ\n\n\n\n\n\n\n\n1.85m\n \n \n\n6' 0.75\"\n\n\n\n\n9th\n\n\n400\n\n\n\n\n\n\n\n46.78\n \n\n\n\n1st\n\n\n110H\n\n\n\n\n\n\n\n13.98\n (1.9) \n\n\n\n1st\n\n\nDT\n\n\n\n\n\n\n\n39.91m\n \n \n\n130' 11\"\n\n\n\n\n8th\n\n\nPV\n\n\n\n\n\n\n\n4.70m\n \n \n\n15' 5\"\n\n\n\n\n4th\n\n\nJT\n\n\n\n\n\n\n\n55.71m\n \n \n\n182' 9\"\n\n\n\n\n5th\n\n\n1500\n\n\n\n\n\n\n\n4:23.57\n \n\n\n\n1st\n\n
On sites such as Pythex, I'm able to capture everything that comes after 100 (see example). However, when I try using stringr's str_extract, I only receive ""
as an output
dec_res <- "\nDec\n\n\n\n\n\n\n8238\n\n\n\n \n \n\n1st \n\n\n100\n\n\n\n\n\n\n\n10.40\n (1.5) \n\n\n\n1st\n\n\nLJ\n\n\n\n\n\n\n\n7.47m\n (1.4) \n \n\n24' 6.25\"\n\n\n\n\n3rd\n\n\nSP\n\n\n\n\n\n\n\n14.41m\n \n \n\n47' 3.5\"\n\n\n\n\n2nd\n\n\nHJ\n\n\n\n\n\n\n\n1.85m\n \n \n\n6' 0.75\"\n\n\n\n\n9th\n\n\n400\n\n\n\n\n\n\n\n46.78\n \n\n\n\n1st\n\n\n110H\n\n\n\n\n\n\n\n13.98\n (1.9) \n\n\n\n1st\n\n\nDT\n\n\n\n\n\n\n\n39.91m\n \n \n\n130' 11\"\n\n\n\n\n8th\n\n\nPV\n\n\n\n\n\n\n\n4.70m\n \n \n\n15' 5\"\n\n\n\n\n4th\n\n\nJT\n\n\n\n\n\n\n\n55.71m\n \n \n\n182' 9\"\n\n\n\n\n5th\n\n\n1500\n\n\n\n\n\n\n\n4:23.57\n \n\n\n\n1st\n\n"
> str_extract(dec_res, "(?<=100).*")
[1] ""
Is my issue that I don't know R-specific regex syntax? Or, is this a particular behavior of str_extract?