I am struggling with some regex to match the strings I need. This is what I have so far, but it's matching more than I want:
(\w*__c|\w*__r|[a-zA-Z0-9]*)\.\w*__c|\w*__c
Here are some examples of what I want to match/not match:
FFX_GLAAssetDisposalID__c => TRUE
FAM__Asset_Sub_Group__r.PNL_On_Asset_Disposal_GL_Account__c => TRUE
Product2.SalesRevenueAccount__c => TRUE
ffbext__codabecashmatchingreport => FALSE
Product2.c2g__CODASalesRevenueAccount__c => FALSE
Where items are separated by a . the significant thing is the number of __ in the part after the . where there can be no more than one set of __. I've also experimented with negative lookaheads to no avail.