Skip to main content

Split String with Regular Expression

#sending to input of operation
Responsedata = []

# Extract the value of the "org" key
org_value = pycode_data.get("org", "")  # Default to an empty string if "org" is missing

# Split the "org" value into AS and ASN
asn_part, as_part = org_value.split(" ", 1)

# Prepare the response
response = {
    "asn": asn_part,    # ASN value (e.g., AS15169)
    "as": as_part   # AS (e.g., Google LLC)
}

#sending to output of operation
pycode_data.update(response)