Does it look like it should when it changes these variables to real values?
Site URL/lists/List Name/DispForm.aspx?id=ID
Both URL formats display the same ListName.
The URL you get from that regex isn't quite complete ... /lists/ListName/123
Rather use the following to pull out the id and stick it after dispform.aspx?id=