patten matching

Results 1 to 3 of 3

Thread: patten matching

  1. #1
    Join Date
    Dec 1969

    Default patten matching

    I need to find <img = in my string then store ever thing untill the next > add some extra text to the saved string and have all thins in a repace function. any ideas?

  2. #2
    Join Date
    Dec 1969

    Default You need two steps:

    First step is to find the tag:<BR>&#060;%<BR>Dim intStartPlace, intEndPlace, strSelectedText<BR>intStartPlace = InStr(strSearchText, "&#060;img")<BR>&#039; The next line may need a "+1" on the end - you&#039;ll need to check.<BR>intEndPlace = InStr(intStartPlace, strSearchText, "&#062;")<BR>strSelectedText = Mid(strSearchText, intStartPlace, intEndPlace-intStartPlace)<BR>%&#062;<BR><BR>Second step is to replace it with what you want to replace with:<BR>&#060;%<BR>Dim strReplaceWith<BR>&#039; Copy the string<BR>strReplaceWith = strSelectedText<BR>&#039; Take off the "&#062;"<BR>strReplaceWith = Left(strSelectedText, Len(strSelectedText)-1)<BR>&#039; Add on your text<BR>strReplaceWith = strReplaceWith & " your attributes "<BR>&#039; Put back on "&#062;"<BR>strReplaceWith = strReplaceWith & "&#062;"<BR>Replace(strSearchText, strSelectedText, strReplaceWith)<BR>%&#062;<BR><BR>If you want it to do ALL the &#060;img&#062; tags, you need to iterate this until intStartPlace = 0.<BR><BR>Craig.

  3. #3
    Join Date
    Dec 1969

    Default General George Patten??

    oh! "pattern". gotcha.<BR><BR><BR>j

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts