Hi i'm trying to extract all numbers (including decimals) before the ' character using PostgreSQL.
I'm not sure how to specify this because my regular expression is contained between these characters itself. See:
SUBSTRING(long_text, '[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)(?=')') as substring_feet
This results in the following error:
syntax error at or near "') as substring_feet
--,SUBSTRING(long_text, (position((substring(long_text FROM '"
LINE 6: ...ng_text, '[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)(?=')') as subs...
^
I have tried various escapes etc. but can't figure it out.
The expression passes ok using the online tester because this doesn't account for the quotes needed for my query.