RegEx Question

I am using RegExRx to validate and create regular expression statements. I am running into something that I am not sure how to address.

My Expression matches the first octet of a valid IPv4 Address. This works like a champ in the RegExRX tool and matches immediately after I type for example 100.

^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-2][0-3])\.

My Xojo code works but is a character space behind meaning I have to type an extra character after the dot to get my Xojo RegExMatch. I made sure to match my options the same as I had in the RegExRx tool but didn’t matter.

  IPAddressFirstOctet_Check_RegEx = New RegEx
  IPAddressFirstOctet_Check_RegEx.options.caseSensitive = true
  IPAddressFirstOctet_Check_RegEx.options.Greedy = false
  IPAddressFirstOctet_Check_RegEx.options.TreatTargetAsOneLine = false
  IPAddressFirstOctet_Check_RegEx.options.CaseSensitive = False
  
  IPAddressFirstOctet_Check_RegEx.SearchPattern = "^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-2][0-3])\\."

Any ideas? :slight_smile:

Thank you very much in advance!

My buddy suggested that I change events :slight_smile: I moved my code block from the CellKeyDown event (Listbox) and over to the “CellTextChange Event” and it works as expected. My delay must have been because of the keydown.