C Cor Active Member Licensed User Longtime User Dec 7, 2010 #1 I pretty new to the matcher and regex stuff. I want to find 7 and 9 , if both exists in following string C 7+5(-9) will there be a tutorial for matcher and regex? grCor
I pretty new to the matcher and regex stuff. I want to find 7 and 9 , if both exists in following string C 7+5(-9) will there be a tutorial for matcher and regex? grCor
Erel B4X founder Staff member Licensed User Longtime User Dec 7, 2010 #2 If all you want it to check whether both 7 and 9 appear then it would be easier to use IndexOf: B4X: Dim S As String S = "..." If S.IndexOf("7") > -1 AND S.IndexOf("5") > -1 Then ... will there be a tutorial for matcher and regex? Click to expand... I believe so. Though it will not cover the basic of general regular expressions, as their are many online tutorials. This is my favorite: http://www.regular-expressions.info/tutorial.html Upvote 0
If all you want it to check whether both 7 and 9 appear then it would be easier to use IndexOf: B4X: Dim S As String S = "..." If S.IndexOf("7") > -1 AND S.IndexOf("5") > -1 Then ... will there be a tutorial for matcher and regex? Click to expand... I believe so. Though it will not cover the basic of general regular expressions, as their are many online tutorials. This is my favorite: http://www.regular-expressions.info/tutorial.html
C Cor Active Member Licensed User Longtime User Dec 7, 2010 #3 I believe indexof is only valid for the whole string not a part of a string myList[0]="C 7+5(-9)" only return index 0 if both the 7 and 9 exists in myList[0] I will look at the link grCor Upvote 0
I believe indexof is only valid for the whole string not a part of a string myList[0]="C 7+5(-9)" only return index 0 if both the 7 and 9 exists in myList[0] I will look at the link grCor
Erel B4X founder Staff member Licensed User Longtime User Dec 7, 2010 #4 Not sure that I understand what are you trying to match... Upvote 0
C Cor Active Member Licensed User Longtime User Dec 7, 2010 #5 must return true if both 7 and 9 exists in myList[0] myList[0]="C 7+5(-9)" grCor Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 7, 2010 #6 myList is an array of strings? Upvote 0
C Cor Active Member Licensed User Longtime User Dec 7, 2010 #7 dim myList as list mylist is a list grCor Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 7, 2010 #8 So something like: B4X: Dim s As String s = myList.Get(0) If s.IndexOf... Upvote 0
C Cor Active Member Licensed User Longtime User Dec 7, 2010 #9 ok, thanks it works now I was a little confused with indexof, thought that it looks only for complete words grCor Upvote 0
ok, thanks it works now I was a little confused with indexof, thought that it looks only for complete words grCor