function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
randombardrandombard 

is is possible to use wildcards in a formula?

I want to test if a field that contains the ip adress range of our customer is acceptable

 

I thought

 

OR(NOT(isnull(FIND(10.*.*.*, IP_Address__c))),NOT(isnull(FIND(192.168.*.*, IP_Address__c))))

 

however the * is used for multiply and wrapping in " doesnt help

Steve :-/Steve :-/

No you can't, you're probably better off using the REGEX function

randombardrandombard

Hi Stevemo,

 

I am not sure that REGEX will help in this case as there is never a single set format for the IP's that I want to test for. Basically there are some IP's that we will never accept and that is what I am looking to test for on entry.

 

They might be entered as a range 192.168.2.1-192.168.255.255

 

or as a single set 192.168.2.2. in this cases I can see how REGEX might work but not in the previous.

 

I have been an excel superuser and vba programmer for several years but I am very new to SF formulae.

 

I appreciate your help

Steve :-/Steve :-/

Here's an example of a very basic REGEX VR that I pulled from the User Guide, it just ensures that a custom field called IP Address is in the correct format, four 3-digit numbers (0-255) separated by periods. 

but  you might be able to hack it to work for your Use Case 

 

NOT(
REGEX( IP_Address__c,
"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" ))