A shapefile field has text with words separated by blanks " ", dashes "-" and underscores "_". I want to standardise the words to capitalise each word, and then replace spacese (" ") with underscores.
In can do this with one type of word separator (underscores) with
arcpy.CalculateField_management(in_table="xxx.dbf", field="temp", expression="' '.join([i.capitalize() for i in !inField!.split('_', '-')]).replace(' ','_')", expression_type="PYTHON_9.3", code_block="")
but this causes words separated by spaces or dashes to not be capitalised.
I have looked at using the re package but don't know how to call
re.split, which should allow splitting on multiple separators.