I've looked through Regex Last occurrence? but cannot get the regex to work for my example string ("https://www.fakesite.com test one"). I need to return the last character of the website name only (or the position). I have the expressions for both capturing the site and obtaining the last character but cannot get the expression to get the right look behind.
(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]
{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|
(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,}) <- Regular Expression for website
(?=.?$). <- Regular Expression for retrieving last character
I've been using https://regex101.com/ to try and find, but no luck.
How can I retrieve the last character or position?
--Edit--
How can I retrieve just the last character of any string? (I need just the letter 'r' in System Engineer). 'System Engineer' is dynamic.
"for the position of System Engineer located in"
(?<=position of )(.*)(?= located) <- regex to capture System Engineer between words 'position of' and 'located'