RegEx... need help

linum

Active Member
Licensed User
I have an arraylist with different kinds of data but I added key words that I would like RegEx to replace.

For example, the arraylist could contain data as:


"Mr. nnaammee is scheduled for physical therapy on ddaattee."



What is the correct syntax for looping through the arraylist, finding each instance of nnaammee and ddaattee and replacing it with a text value located on a text box?


As always... thank you for your fine help.
 

linum

Active Member
Licensed User
Thank you for your reply. Your example helped me figure out what I needed. Here is the correct syntax I was looking for:

B4X:
       regex1.New1("nnaammee")
   
   For i = 0 To ArrayRefLoad.Count-1
       s = ArrayRefLoad.Item(i)
       s = regex1.Replace(s, txtName.text)
      ArrayRefLoad.Item(i) = s
   Next
 
Top