I'm having a drama labelling using RegEx in QGIS.
Ideally, what I want is the lines labelled WITHOUT the 'Spec' in the middle. Which can be a variation of numbers and characters but I need to retain the '1 x' and '24F'
EDIT; 'Spec' can be a variation of characters. e.g 'ABC123' it wont be the word 'Spec'
So the labels will go from this:
- 2 x Spec - 48F
- 1 x Spec - 96F
- 1 x Spec - 12F
To this:
- 2 x 48F
- 1 x 96F
- 1 x 12F
I'm currently using this in the Expression dialog window of the labelling engine;
regexp_replace( "value", (regexp_substr( "value", '[x](.*)?[- ]1')),'')
This works for the multi line values, those with a return. But it eliminates anything on a single line.
I need the single line values as well as the multi line strings.
Any pointers on what I could be missing?
replace("value", ' Spec', '')
?