I am fiddling with addresses, where I would like to remove the street number.

So far I found some solutions leading to explain how to get rid of the numbers but from the right side of the string:

Extract left part of field with regexp_substr after two specific charaters Removing string to the right of a character using QGIS Field Calculator? How to split string, removing digits keeping letters/words

as well as some options with replacing the parts of the string:

Replacing characters using an expression in QGIS How to extract part of string after '*', '~', '-' or '#' Replace using regular expression?

but I couldn't find either how to remove the number from the end of the string nor what is the definition of any number in QHIS expressions:


I used these 2 codes but both didn't work as expected:

  right ( "Address L1", length("Address L1")-regexp_match("Address L1" ,'(_S\\d+)')-2)

  substr("Address L1",regexp_match("Address L1",'')+2)

because they take down just the first 2 characters some addresses are fine, other ones have additional space at the very beginning and others still keep some numbers. I need something, which would allow me to remove the stuff before the first space. Is it possible?

enter image description here

  • 1
    Correction: You want to remove the part before the first space, if that part consists of numbers. Otherwise you'd end up with facility instead of recycling facility. You know how to check for numbers, so use this as your condition, and then regexp_match() for spaces if there are numbers in the address.
    – Erik
    Commented Mar 15, 2022 at 14:56
  • Yes, I want to get rid of everything before the first space. How can I do this?
    – Geographos
    Commented Mar 15, 2022 at 15:09

1 Answer 1


To remove the numbers at the beginning of the string and its optional following space, you can use


^: beginning of the string
\\d: followed by any digit
*: found 0 or more time
\\s: followed by a space
?: found 0 or 1 time

  • 1
    Love the breakdown of the reg exp. Maybe I can remember it this time.
    – Erik
    Commented Mar 15, 2022 at 15:23
  • Yes, so do I! It's a good way to understand it. @JGH how can we follow it by the second, third space, etc?
    – Geographos
    Commented Mar 15, 2022 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.