Professional Web Applications Themes

Getting amount of Occurrences - Macromedia ColdFusion

My mind has gone blank... can't think of how to do this. I have a varable with text in it (CFHTTP.Filecontent). I need to see how many times '<table sytle='changeit'>' appears in that Filecontent varable. How can I do this. Thank you!...

  1. #1

    Default Getting amount of Occurrences

    My mind has gone blank... can't think of how to do this. I have a varable with
    text in it (CFHTTP.Filecontent). I need to see how many times '<table
    sytle='changeit'>' appears in that Filecontent varable. How can I do this.
    Thank you!

    Vbprog40 Guest

  2. #2

    Default Re: Getting amount of Occurrences

    Use refindNoCase or refind

    If you use parentheses to denote subexpressions within the regular expression,
    the returnsubexpressions parameter returns the position and length of the first
    match of the regular expression in the first element of the respective arrays;
    the position and length of the first instance of each subexpression within the
    regular expression are returned in subsequent array elements.

    Ken

    The ScareCrow Guest

  3. #3

    Default Re: Getting amount of Occurrences

    Thanks, but I need to get a total number of how many Occurrensces there are of that expression. ReFind will only tell you the position the next one is in.

    Any other ideas?
    Thanks
    Vbprog40 Guest

  4. #4

    Default Re: Getting amount of Occurrences

    No, you need to read the text I posted from the docs

    the position and length of the first instance of each subexpression within the
    regular expression are returned in subsequent array elements.

    Thus the length of this array will give you the number of occurences.

    Ken

    The ScareCrow Guest

  5. #5

    Default Re: Getting amount of Occurrences

    MikerRoo Guest

  6. #6

    Default Re: Getting amount of Occurrences

    Thank you both for your help! Worked great!
    Vbprog40 Guest

Similar Threads

  1. FIND Amount in String
    By Vbprog40 in forum Macromedia ColdFusion
    Replies: 5
    Last Post: June 13th, 10:38 PM
  2. Strange memory occurrences with MX on XP
    By Flashster in forum Macromedia Director Basics
    Replies: 2
    Last Post: January 17th, 01:54 AM
  3. Amount of data
    By Scherbina Vladimir in forum ASP.NET General
    Replies: 1
    Last Post: July 29th, 10:45 AM
  4. Total ink amount VS readout
    By Adam Bilinski in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 1
    Last Post: July 15th, 08:21 PM
  5. How get number of occurrences in a variable?
    By malcolm k in forum Microsoft SQL / MS SQL Server
    Replies: 0
    Last Post: June 30th, 03:59 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139