I'm having issue with the following code, not sure how else I can write it
(defun padname (strg)
(string-match "[uU]_\\(.*\\)\\(_[0-9\]+\\)?" strg)
(match-string 1 strg)
)
(padname "u_CLR_REQ_SUP_00")
"CLR_REQ_SUP_00" ==> expect "CLR_REQ_SUP"
(padname "u_CLR_REQ_SUP_0")
"CLR_REQ_SUP_0" ==> expect "CLR_REQ_SUP"
(padname "u_PTO_AVDD_3P3_0")
"PTO_AVDD_3P3_0" ==> expect "PTO_AVDD_3P3"
(padname "u_PTO_0")
"PTO_0" ==> expect "PTO"
(padname "u_PTO")
"PTO" ==> as expected
(padname "u_BTNI")
"BTNI" ==> as expected