matcher question

Cor

Active Member
Licensed User
Longtime User
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
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?
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

Cor

Active Member
Licensed User
Longtime User
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

Cor

Active Member
Licensed User
Longtime User
ok, thanks it works now

I was a little confused with indexof, thought that it looks only for complete words


grCor
 
Upvote 0
Top