QGIS Expression – How to Select Values Without Numbers

addressexpressionqgis

I would like to select the values which have no numbers in their string.

For this purpose I used the following code:

CASE WHEN 
 regexp_match("Address L1", '^\\d*\\s?')
 THEN
 NULL 
 ELSE
 "Address L1"
 END

In order to paste them in a different column. Unfortunately, it doesn't work. The same as other approaches beneath:

 CASE WHEN 
 regexp_match ("Address L1",<>( '^\\d*\\s?'))
 THEN
 NULL 
 END

 CASE WHEN 
  regexp_match <> ("Address L1",( '^\\d*\\s?'))
  THEN
  NULL 
  END

the code below

 CASE WHEN 
 "Address L1" <> regexp_match ("Address L1",( '^\\d*\\s?'))
 THEN
 "Address L1"
 END

changed everything badly

enter image description here

Is there a way of selecting just these strings, which don't have numbers?

Best Answer

You can use this expression to copy all fields having no number at all in it:

if(not regexp_match("field",'[\\d]'),"field",NULL)

Or this expression to copy all fields not starting with a number:

if(not regexp_match("field",'^([\\d])'),"field",NULL)
Related Question