How do i target something from the end of a string :
complexthing---50
other-_-50
MORE__------50
i want to end up with (50) but this “complexthing–” can end with – so in this case i cant break at ” – ” from the begging that might make it be confused so the easiest regex for me is to make it get whatever at the end and break at ” – “
-(.*)
there is always a – before every 50 to seperate the number and the string, i want to target the number (50)
If I understand you correctly, something like this might work:
Match hyphen (-) followed by one or more digits (\d+) just before the end of the string ($). Capture the digits only ( (…) ).