With the format you showed us this should work:
[{"id":"9fd5c36b0660ab65","type":"function","z":"c513d12c.45645","name":"","func":"\nconst regex = /.*\\[(-?[\\d\\.]+),(-?[\\d\\.]+)/;\nconst found = msg.payload.match(regex);\nif(found != null){\n msg.lat = found[1];\n msg.lon = found[2];\n return [msg, null];\n}else{\n return [null,msg]\n}\n\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1720,"wires":[["87e6e9d137a4bea6"],["25b4c4844d748e54"]]},{"id":"921b07b701682dc7","type":"inject","z":"c513d12c.45645","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":",SHELLHARBOUR COUNCIL (NSW),2529 - [150.843460083008,-34.6033782958984]","payloadType":"str","x":340,"y":1720,"wires":[["9fd5c36b0660ab65"]]}]
The function node has this code:
const regex = /.*\[(-?[\d\.]+),(-?[\d\.]+)/;
const found = msg.payload.match(regex);
if(found != null){
msg.lat = found[1];
msg.lon = found[2];
return [msg, null];
}else{
return [null,msg]
}
The upper debug will get triggered if there is a lat lon in the payload.
If not then the lower will be triggered.