I need to extract group of words out of a column in the database. Users saved terminus of bus line in a pretty nasty way, and I need to extract them.
For example :
'Bétheny La Couturelle - Croix Cordier - Tinqueux Champ Paveau'
- {Bétheny La Couturelle}
- {Croix Cordier}
- {Tinqueux Champ Paveau}
I've tried this pattern:
,'([a-zA-Zéèàîùê]+(\s|\-)?)+', 'g');
ex :
select regexp_matches('Bétheny La Couturelle - Croix Cordier - Tinqueux Champ Paveau','([a-zA-Zéèàîùê]+(\s|\-)?)+','g')````
The 'g' flag for capturing every matches.
But it doesn't work.
All I obtain was :
- {e , }
- {r , }
- {u,NULL}
How may I succeed ?
Thanks in advance.