I have two regex expressions in R which are giving me the same output, despite the presence of parentheses in one of them. Here they are:
regmatches("[60.0 - 119.0]",regexpr("[0-9]+\\.0\\]$","[60.0 - 119.0]"))
regmatches("[60.0 - 119.0]",regexpr("([0-9]+)\\.0\\]$","[60.0 - 119.0]"))
Both of these expressions yield '119.0]' (without the quotes). It is my understanding that the second expression should find the same piece of the string but only return the piece in parentheses, which in this case is the numbers before the decimal point, like so: '119' (which is what I want).
What am I missing in either my understanding or execution of this code?