i have the following string
https://www.example.com/int/de
and want to match the language code at the end of the url, eg 'de' i do that with this regex
/\..*\/.*\/([^\/?]*)\/?$/gi
I would also like to get the same result if the URL ends with a slash
But with https://www.example.com/int/de/
i only get a full match, but the group dont match 'de' anymore, although the last slash is optional in the regex
can someone the my mistake here?