You don't indicate whether you are alwasy looking for "Harry" or if this is a criterion specified by the user, but the technique is basically the same:
Let ( Hpos = Position ( YourText ; "Harry" ; 1 ; 1 ) ;
Position ( YourText ; "<div>" ; Hpos ; 1 )
Will return the position of the < in the first instance of "<div>" located after the first instance of "Harry".
Thank you for the respone. This is a little beyond me. Could you tell me how I would put that into a script? Also how would I replace the <div> with <divider>. Please excuse my ignorance, but I am a casual Filemaker user. I thought I could just use the find and replace functions. Thanks for your kind help.
As far as I know, Find and replace can't be set to search starting from a point inside the a block of text in a text field.
As a script you might do it this way:
Set variable [$DivPos ; value: Let ( Hpos = Position ( YourTable::YourTextField ; "Harry" ; 1 ; 1 ) ; Position ( YourText ; "<div>" ; Hpos ; 1 ) ) ]
If [$DivPos //make sure that <div> after "harry" was actually found]
Set Field [ YourTable::YourTextField ; Left ( YourTable::YourTextField ; $DivPos - 1 ) & "<divider>" &
Right ( YourTable::YourTextField ; Length ( YourTable::YourTextField ) - $DivPos - 4 ) ]