i cannot find answer to my question
Salesforce Ids are 15 or 18 characters of Base 62 data. They consist of the characters [A-Za-z0-9]
.
So long as your application preserves the case of the Id, the final three characters, which serve as a disambiguator for non-case-safe applications like Excel, can be ignored. Then, you can match REF<Salesforce Id>
with the regex
REF[A-Za-z0-9]{15}