Regex capturing is possible in Search/replace (must be enabled under "More Options"), but I don't know if you can use capturing in formulae.
An alternative way:
=VALUE(MID(L115;FIND("(";L115)+1;4))
Question
I have a worksheet (OpenOffice sCalc) with many rows of data, MOST of them have a year enclosed in ()
One of the cell's has this content: Mary had a little lamb, Sarah Josepha Hale (1830)
I would like to capture the year and save it in the cell to the right.
This stmt will tell me if a year is present:
=IF(COUNTIF(L115; ".*[(][0-9]{4,4}[)].*");"hooray"; "boo")
When I try to replace "Hooray" with $1 in this stmt I get an error:
=IF(COUNTIF(L115; ".*([(][0-9]{4,4}[)]).*");$1; "boo")
I get this: #REF!
What is the correct syntax? Thank you in advance!
Solution
Regex capturing is possible in Search/replace (must be enabled under "More Options"), but I don't know if you can use capturing in formulae.
An alternative way:
=VALUE(MID(L115;FIND("(";L115)+1;4))