I want to select featurs from a Feature Class by using "arcpy.management.SelectLayerByAttribute" with a built-in Regular Expression.
The expression should follow this scema: Select all values in the attribute "name" starting with an "A" letter which is followed by a space " " which is followed by a random number series, e. g. "A 213" or "A 1". All other values starting with an "A" should not be selected, e. g. "A Court" or "Anson Street".
I tried many ways, including using the "re" modul, but nothing worked. Here is one easy code example that didn't work:
# SQL-Query with RegExpr
sql_expression = "name LIKE 'A %' AND regexp_like(SUBSTRING(name, 3, 1), '^[0-9]$')"
# Slect
arcpy.management.SelectLayerByAttribute(feature_class_path, "NEW_SELECTION", sql_expression)
Thanks in advance for any help