raphipps2002 Active Member Licensed User Longtime User Nov 4, 2015 #1 I have a spinner/combobox object with items made of two parts separated with '|' The combobox's ID is cmbBankID e.g. Bank|123 Paypal|345 Savings|987 I want to identify each part i.e. Payal and 345 or Savings and 987 B4X: Dim BID() As String BID = Regex.Split("|",cmbBankID.Value) Using Payal|345 But using the regex is get in Bid(0) = P and bid(1) = a And not 'Payal' and '345' as expected..... what am i doing wrong? thanks
I have a spinner/combobox object with items made of two parts separated with '|' The combobox's ID is cmbBankID e.g. Bank|123 Paypal|345 Savings|987 I want to identify each part i.e. Payal and 345 or Savings and 987 B4X: Dim BID() As String BID = Regex.Split("|",cmbBankID.Value) Using Payal|345 But using the regex is get in Bid(0) = P and bid(1) = a And not 'Payal' and '345' as expected..... what am i doing wrong? thanks
MaFu Well-Known Member Licensed User Longtime User Nov 4, 2015 #2 '|' is a special char in regular expressions used for 'or'. Therefore you must escape it, try '\|'. Upvote 0
raphipps2002 Active Member Licensed User Longtime User Nov 5, 2015 #3 I see....so how many special characters are there? Is it possible and safe therefore to put then escape all the time so cover all eventualities Upvote 0
I see....so how many special characters are there? Is it possible and safe therefore to put then escape all the time so cover all eventualities
derez Expert Licensed User Longtime User Nov 5, 2015 #4 The special characters are called "metacharacters", read this https://en.wikipedia.org/wiki/Regular_expression. The escape cancels the special meaning of the special character when used in regex. Upvote 0
The special characters are called "metacharacters", read this https://en.wikipedia.org/wiki/Regular_expression. The escape cancels the special meaning of the special character when used in regex.