I am looking for a PCRE regular expression match pattern with which I can use in C language to extract the tail fragment of a string. My expected effect is to extract the string following string "en", which can be immediately followed by nothing, with or without slash(es) "/". If the first character following "en" is slash, ignore or trim it off before return the captured string. The input characters are pure ASCII in lower cases.
input-string match captured-string
---------------------------------------
english/japan no
en yes
en/ yes
en/japan yes japan
en//japan yes japan
en/japan/tokyo yes japan/tokyo
en//japan/tokyo yes japan/tokyo
en// yes
Thank you in advance!