In ArcMAP 10.2, I am trying to format the labels on my map.

If the label is

1402 Bowie Road

But I want only to display numbers:


What is the expression to create this?

  • 1
    I'm not sure if 10.2 is different to 10.1 in this respect but you can do this using advanced label options.. use var = split(field," ") and label using var[0] which is the first item in the list. Apr 7, 2014 at 2:41
  • 1
    alternatively in VB use left( [field], instr( [field] ," ")) to return just the first word of a sentance. Apr 7, 2014 at 2:44
  • The split operation can be done in one line with VB Script. To get the first word before the first space use: split(field, " ")(0) Oct 1, 2014 at 16:18

3 Answers 3


You can put this as the label expression for the feature:

def FindLabel(yourField):
    if yourField is not None:
        split_field = yourField.split(" ")[0]
        return str(split_field)
        return None

Using Python as the parser and checking the Advanced box.

Replace yourField with whatever field you are using to label.


An alterntive to ian's suggestion, you can change your label expression to something like the following. By importing the regular expression module, you can create function to only display numbers at the beginning of a string.

def NumberLabel(addressField):
    import re
    return re.search('^\d*', addressField).group()

As per Ian's example, use python as the parser.

This will return the number at the beginning of a string.

1402 Bowie Road will return 1402     
123 Main Street will return 123     
123 Main Street Unit 4 will return 123    
515 4th Avenue will return 515    
613Main Street will return 613

Note that last example does not have a space after the number yet still returns the correct result.


Another alternative to both Ian and Fezter's answers is to use the INSTR and MID VB script functions (This particular expression does not require you to be in an Advanced Expression mode):

MID([Your_Field], 1, INSTR([Your_Field]," "))

INSTR function has the following parameters: InStr([start,]string1,string2[,compare])

MID function has the following parameters: Mid(string,start[,length])

Square brackets indicate optional parameters

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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