Question: I want to submit a score to my leaderboard. Sometimes it works but sometimes i get the error: 

```
Error Code 6: STATUS_NETWORK_ERROR_OPERATION_FAILED

```

I am connected to the internet and enabled multiplayer in the developer console. Any ideas? 

Here is my code:

MainActivity:

```
if(isSignedIn()){
        Games.Leaderboards.submitScoreImmediate(mGoogleApiClient, this.leaderboardId,
                targetScore).setResultCallback(new LeaderBoardSubmitScoreCallback(this));
}

```

LeaderBoardSubmitScoreCallback:

```
@Override
public void onResult(Leaderboards.SubmitScoreResult res) {
    Log.d("mylog","leaderboard upload result "+res.getStatus().getStatusCode()+": "+res.getStatus().getStatusMessage());
    if (res.getStatus().getStatusCode() == 0) {
        activity.showToast(activity.getApplicationContext().getString(R.string.score_submitted));
    }else{
        Toast.makeText(activity.getApplicationContext(),activity.getString(R.string.error)+": "+res.getStatus().getStatusMessage(),Toast.LENGTH_LONG).show();
    }
}

```

Answer: 
You can use this lazy regex:

```
(.*?) \((.*)\)[^()]*$

```

[RegEx Demo](https://regex101.com/r/yQ8xI8/1)

Examples:

```
>>> reg = r'(.*?) \((.*)\)[^()]*$'

>>> s = 'Bell St/Oriel Rd (Bellfield (3081))'
>>> re.findall(reg, s)
[('Bell St/Oriel Rd', 'Bellfield (3081)')]

>>> s = 'Stud Rd/(after) Ferntree Gully Rd (Scoresby)'
>>> re.findall(reg, s)
[('Stud Rd/(after) Ferntree Gully Rd', 'Scoresby')]

```
I would use this scheme, given `t` being your text:

```
last = re.findall('\([^())]+\)', t)[-1]

```

The regex searches for an opening parenthesis, then take everything that is neither opening nor closing parenthesis, and then matches the closing parenthesis. Since there could be more than one like this, I use `findall` and take the last one.