Search muliptle tag in a String

Hi,
   I want to search some muliptle tag in a String and their index .  i can get serach() but it gives only first occurence of a word,not for all. so do u  have any idea how to fix this Problem,please Help .
   I am working in cs5.

Check this
http://www.baconandgames.com/2011/11/29/find-all-strings-within-a-string-with-as3/

Similar Messages

  • How to search special characters in a string

    Hi all,
    I want to search special characters in all string columns and all rows in the table.
    The table has about 5 string columns and about 5.000.000 rows. For each row and column, I have to search entries, which included special characters like ", !, ? or something else (f.ex. "Mama?Mia" or "!!!Hotel out of order!!!"). The problem, the character could stand at each position in the string.
    What's the best and most performance possibility to search such entries?? Is it possibility only by SQL; is there a special function for this?? Or must I use PL/SQL.
    Thanks for helping
    Dana

    HTH
    Laurent Schneider
    OCM DBA
    SQL> select * from z;
    S
    Mama?Mia
    a b c
    123
    SQL> select * from z where translate(s,'~ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz1234567890','~') is not null;
    S
    Mama?Mia
    SQL> select * from z where regexp_like(s, '[^[:alnum:][:space:]]');
    S
    Mama?Mia

  • Integrate html tags in a string and display it in a multiline text area

    Hi ABAPers!!
    First of all let me tell you that I'm working in ACCENTURE Casablanca(Morocco) and this is my first Job in my career.
    I'm working on an ALV OO, the program consists on creating an ALV using OO, In my selection screen there's a parameter of type ddobjname I provide the name of table and it returns the table's fields in another dynpro (screen0100), To do this I used the FM: 'DDIF_FIELDINFO_GET' then I append the internal table returned in another one to add the field CB (CheckBox), and I add a button in the toolbar, the function of this button is to generate a MySQL script To create the table provided by the user in my parameter (Screen 1000), but the fields of this table(MySQL) in the generated script are only the selected ones by cheking the checkbox in the ALV.
    I store my script in a string.
    My problem is that I want to show my script in a text area, but I don't know how to create a multiline text area!!
    And I want to use HTML tags in my string.
    I don't want to my string like this :
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI ( CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY , FLTIME INT ( 10 ) , DEPTIME DATETIME ( 6 ) , DISTANCE DOUBLE ( 9 ) , FLTYPE VARCHAR ( 1 ));
    But I want it to be shown like  this:
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI (
    CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY ,
    FLTIME INT ( 10 ) ,
    DEPTIME DATETIME ( 6 ) ,
    DISTANCE DOUBLE ( 9 ) ,
    FLTYPE VARCHAR ( 1 ));
    Thanks in advance
    Regards
    SMAALI Achraf
    Edited by: SMAALI90 on May 11, 2011 7:12 PM

    Hi again!!
    You know what!! let's forget the HTML and focuse on what I want to show.
    As I told you, I've a string which contains my script.
    I don't want that it will be shown as a simple line like this :
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI ( CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY , FLTIME INT ( 10 ) , DEPTIME DATETIME ( 6 ) , DISTANCE DOUBLE ( 9 ) , FLTYPE VARCHAR ( 1 ));
    But I want it to be shown as follows:
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI (
    CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY ,
    FLTIME INT ( 10 ) ,
    DEPTIME DATETIME ( 6 ) ,
    DISTANCE DOUBLE ( 9 ) ,
    FLTYPE VARCHAR ( 1 ));
    and finally I want to show it in a multiline text area.
    Plz what shud I do?!!! If possible I need a piece of code.
    PS : I create a HTML Viewer using this code :
    DATA : go_conteneur          TYPE REF TO cl_gui_docking_container,
                 go_controle_html    TYPE REF TO cl_gui_html_viewer.                 
      CREATE OBJECT go_conteneur                     
        EXPORTING                                    
          repid     = sy-repid                       
          dynnr     = '0100'                         
          side      = go_conteneur->dock_at_bottom   
          extension = 1000                           
          name      = 'CONTENEUR'                    
        EXCEPTIONS                                   
          OTHERS    = 1.                             
      CREATE OBJECT go_controle_html                 
        EXPORTING                                    
          parent = go_conteneur                      
        EXCEPTIONS                                   
          OTHERS = 1.
    But when it's shown my ALV disappears!!!

  • Tell me Logic for search for duplicate words(or strings) in a large file.

    Search for duplicate words (or strings) in a text file containing one word per line. For each word that occurs more than once in the flat file output should be as follows
    <word> <number of occurrences> <line numbers in the file where the word occurs>
    For example, if the word Hello occurs thrice in a file at lines 100, 178 and 3456 the output should read
    Hello, 3, [100, 178, 3456]

    Incidentally i wrote similar code some days back. You need to do some modifications to get the exact output you want, but i hope it will be of some help.
    One more thing its written using JAVA5
    public class Test
         private static final String COLLECTIONS_TEXT = "C:\\Documents and Settings\\amrainder\\Desktop\\Collections.txt";
         public static void main(String[] args) throws IOException
              findDuplicateWords();
         private static void findDuplicateWords() throws IOException
              Collection<String> words = new LinkedHashSet<String>();
              File file = new File(COLLECTIONS_TEXT);
              StreamTokenizer streamTokenizer = new StreamTokenizer(new FileReader(file));
              int token = streamTokenizer.nextToken();
              while(token != StreamTokenizer.TT_EOF)
                   if(token == StreamTokenizer.TT_WORD)
                        words.add(streamTokenizer.sval);
                   token = streamTokenizer.nextToken();
              System.out.println(words);
    }Cheers,
    Amrainder

  • Searching for numbers in a string

    I am trying to filter passwords stored in a string variable and ensure that they contain at least a number and one capital letter.
    how do you search for numbers in a string and search if that string contains a character in uppercase?

    function checkString(username){
    var userfield = username;
    var valid = '0123456789ABCDEFGHIJKLMN�OPQRSTUVWXYZ'; // define valid characters
    if(!isValid(userfield.value,valid)){
    alert("Invalid user name format");
    userfield.value="";
    userfield.select();
         userfield.focus();
    }else{
    err = 0;
    userfield = userfield.value;
    function isValid(string,allowed) {
    for (var i=0; i< string.length; i++) {
    if (allowed.indexOf(string.charAt(i)) == -1)
    return false;
    return true;
    }

  • How to remove HTML tags from a String ?

    Hello,
    How can I remove all HTML Tags from a String ?
    Would you please to give me a simple example ?
    Best regards,
    Eric

    Here's some code I cooked up. I have created an object that processes code so that it can be incorporated directly into a project. There is some redundancy so that the it can be used in more than one way. Depending on your situation you might have to make the condition statement a little more sophisticated to catch stray ">" tags.
    I have also included a Tester application.
    //This removes Html tags from a String either by submitting the String during construction and then
    // calling getProcessedString() or
    // by simply calling " stringwithoutTags=removeHtmlTags(stringWithTagsSubmission); "
    //Note: This code assumes that all"<" tags are accompanied by a ">" tag in the proper order.
    public class HtmlTagRemover
         private String stringSubmission,processedString,stringBeingProcessed;
         private int indexOfTagStart,indexOfTagEnd;
         public HtmlTagRemover()
         public HtmlTagRemover(String s)
              removeHtmlTags(s);          
         public String removeHtmlTags(String s)
              stringSubmission=s;
              stringBeingProcessed=stringSubmission;
              removeNextTag();
              return processedString;
         private void removeNextTag()
              checkForNextTag();
              while((!(indexOfTagStart==-1||indexOfTagEnd==-1))&<indexOfTagEnd)
                   removeTag();
                   checkForNextTag();
              processedString=stringBeingProcessed;
         private void checkForNextTag()
              indexOfTagStart=stringBeingProcessed.indexOf("<");
              indexOfTagEnd=stringBeingProcessed.indexOf(">");
         private void removeTag()
              StringBuffer sb=new StringBuffer("");
              sb.append(stringBeingProcessed);
              sb.delete(indexOfTagStart,indexOfTagEnd+1);
              stringBeingProcessed=sb.toString();
         public String getProcessedString()
              return processedString;
         public String getLastStringSubmission()
              return stringSubmission;
    public class HtmlRemovalTester
         static void main(String[] args)
              String output;
              HtmlTagRemover h=new HtmlTagRemover();
              output="The processed String: "+h.removeHtmlTags("<Html tag>This is a test<another Html tag> string<yet another Html tag>.");
              output=output+"\n"+" The original string:"+h.getLastStringSubmission();
              System.out.print(output);

  • Stripping HTML Tags from a String

    What's the best way to remove html tags from a string (i.e. user input)?

    Can you give an example? You can do substring, if your passing spaces between pages you can do a trim to the variable. Also look at the indexOf(). Look at methods relating to java.lang.String.

  • HTML tag in Coldfusion string not appearing

    Hey guys I'm wondering what I'm doing wrong when trying to
    store an html tag in a string. Basically I'm dynamically creating a
    list for use in a javascript menu, so when building the menu, I do
    this:
    menu = "< ul id = """ & mainID & """
    ><br>";
    to generate a list (of course thats only part of the list
    code). This line produces < ul id = "mainID" >
    What I need is for the spaces to be removed, so it would
    produce <ul id="mainID">
    But in my Coldfusion function, if I write:
    menu = "<ul id=""" & mainID & """><br>";
    nothing shows up! A space between < and ul works fine, but
    once I delete them, nothing! Any help would be really appreciated,
    thanks.

    actually found the answer elsewhere, I declared a variable
    open = &lt; now instead of using the <, i just write open,
    which generates the list fine.
    but a followup, the list is being generated now, but on the
    page instead of the javascript/css menu catching it and formatting
    it, it just displays the whole list, tags and all. I tried
    htmlEditFormat( ), that only changed all the symbols to their I
    guess ASCI couterparts. Any ideas why its showing the list as text
    rather than creating a menu??
    also I tried it without the menu, which should have shown a
    bulleted list, but that didn't work either...

  • Search for tags in Spotlight?

    How come I can search using Tags in the Finder but not when trying to search using the new Spotlight in Yosemite?
    Thank you.

    You search it by typing tag:<tagname>
    So I have a tag called "documentation" so I just type tag:documentation in the Spotlight field. Works great.
    If you choose the "show all in finder" option you can see that it works fine.

  • When will Adobe update DIGITAL EDITIONS - to search and tag, and to back-up structure?

    When will Adobe update DIGITAL EDITIONS to include the ability to 'find your books' by searching and tagging?
    Also, how does one 'back-up' the organization structure? I have hundreds of books that i've organized by "Bookshelves" and i KNOW this will someday become corrrupted, somehow, and i will need to spend countless hours trying to put multiple books in multiple categories again.
    [i've backed-up (besides the books themselves) "Annotations", "Mainfiest", "Tags" and "Thumbnails" but there doesn't seem to be a complementary file/folder for DIgital Editions in USER/AppData]
    many thanks
    Photoshop user since v1.0

    TM is not designed to do what you ask. As Allan wrote TM is an incremental backup not an archival solution.
    If you delete a file from the HD it will eventually be removed from the TM backup (if it ever makes it on to the backup at all).
    How long before it is removed depends on a number of factors, TM disk drive size being one factor but not the only one.
    Material that is impossible to replace and is important to you (image files usually fitting that description) need to be backed up to as least one other drive and preferably more for long term storage.

  • How does searching for tags in different languages work?

    I have a website in English an German (and eventually also in French and Italian) to which I would like to assign the tag Lawyer (English) / Anwalt (German). Therefore I have set up the tag in the UI as below and tagged the page manually to try if it works. Everything works well, but when I search for the tag I can only find the pages by typing in the tag name (here lawyer), but I would also like to find it by typing in Anwalt. Is there a possibility to make the tags searchable in all languages except for creating a new tag for each language?
    How do I have to put it here etc/tags/marketing:lawyer? Do I have to translate the tags first in the UI? I assume, that if I put etc/tags/marketing:anwalt, a new tag is created.
    Thanks for your help!

    What do you mean by "etc/tags/marketing:lawyer" - where do you put this? Such strings are not expected to work.
    There are tag ids, which are based on the node names of the tag and which are not localized. In this case it would be "marketing:lawyer" or /etc/tags/marketing/lawyer (absolute paths work as well, albeit they are not written by the built-in tagging code). These would be used in the GQL search query in the normal search field in the content finder, using "tags:<tagid>", for example: "tags:marketing:interest/business"
    Then there are titles, which you see in the tag labels when setting tags e.g. on a page, such as "Marketing : Lawyer", or "Marketing : Category / Subcategory" for nested tags. Titles are localizeable. If you have the suggestions enabled in the cf, you'd type e.g. "Lawyer" (user language set to English) or "Anwalt" (user language set to German), see a list of suggested items, select the tag (recognizable by icon) and the search field should be populated with "tags:marketing/lawyer" automatically.
    See also
    http://dev.day.com/docs/en/cq/current/wcm/tag_admin.html#Managing%20Tags%20in%20Different% 20Languages
    http://dev.day.com/docs/en/cq/current/developing/tagging.html

  • I need to search in a line a string but...

    Hi there!, I hope you can help me with my problem...
    I have a line from an html file like this:
    String lineToSearch = "<b>This is a line with a different font<b>"
    Well, I have a method that searchs a word or a character in the variable lineToSearch, and it works fine, but it doesn't know to differentiate between a normal character and the tags of an html file, if I want to search the word "font" in the variable lineToSearch, works good, but if the variable have a different line like this:
    lineToSearch = "<font color = yellow>This is a line with a different font</font>"
    find three time the word, how can I avoid the tags???

    Ok the logic is to try to indentify in your string the <bla bla > statements and process only the value...one way (prob my implementation is not very nice but works ok for now
    in a string like that :
    "<font color = yellow>This is a line with a different font</font>"
    we can identify 2 <bla bla> substrings and the value substring
    The thing we want is the string between the > and the < right?
    This is a line with a different font<So the logic of the code is convert string to char[] array .search the indexes of the < and > characters
    in a string like that < blabla > adfasdfasdf </blabla> searching for < and > will give as 4 indexes
    so using the indexes of the first > and the second < as they appear in the string we give as the value only...after that you can call your method to process the string
    public String giveSubString(String s) {
    s="<font color = yellow>This is a line with a different font</font>";
    char[]r=s.toCharArray();
    Vector indexes= new Vector();
    for(int x=0;x<r.length;x++)
    if(r[x]=='<'||r[x]=='>')
    indexes.add(new Integer(x));
    String s1 = s.substring(((Integer)(indexes.get(1))).intValue()+1,((Integer)(indexes.get(2))).intValue());
    System.out.println(s1);
    return s1;
    This logic wont work for a string like that <bla><c>sadfsadfasdf</c></bla> but you can easily modify the logic with the indexes
    I hope it helped...if your need further assistance dont hesitate to email me ..because I cant visit the forum so often
    [email protected]

  • Search does not find text string in a PDF file

    Some of the PDFs on my company's website have text that does not come up in a search of the PDF. You can see the text on the page, but it's ignored in a search. When I open the PDF and use the Select tool to copy the six-character string, then paste it into the Search field of the open PDF, the string pastes into the Search window as open boxes. While that might explain why the string is not found in the search, I'm confused about why the characters are correct on the PDF page, but not after they are copied and pasted.
    Here is an example: Search for this word in the attached PDF file:
    control
    The search will miss the first occurrence of Control in the first bullet on the page.

    Most of the fonts are embedded (except 1), but that does not mean you can search them as mentioned. The simplest way to avoid the problem is to go back to more standard fonts, like Arial, Courier, Times New Roman, and such. You may still have a problem with MAC users where they have Helvetical and Times Roman as standard. However, most of the common fonts have the same character associations and it is likely not a problem.

  • Search and Replace vi adds new text behind initial input when search critera is a empty string.

    Can anyone tell me what I am doing wrong?
    Want output to show N/A when nothing is entered in input string and to show the input string if something exists...
    The output of the attached VI is expected it to be Larron, but instead is outputting LarronN/A.
    Is there a way to make this VI do this without having to make a VI with an and/or component added to it?
    Attachments:
    SNR EX.vi ‏7 KB

    Right-Click the S&R function and select 'Regular Expression'
    Search for ^$, replace with 'N/A'

  • Search set of Characters in String in mapping

    Hello All,
    I want to search for a set of characters in a string and I want to do this in mapping.
    Can anyone help me in resolving this?
    Example:-
    String = "SAP PI is an Integration Tool"
    Search = "an Integ"
    OR
    just search for "an Integ" in the String.
    The String length can always change and the position of "an Integ" can also change.
    Please help!
    Thanks for your help and time,
    Abhi
    Edited by: Abhi_1516 on Nov 19, 2009 7:08 PM

    Thanks Sunil, for your quick response.
    I tried using that, but it's returning the index of the first occurrance of the Sub String and not "-1" as you have described.
    I am trying to write an UDF and I am getting syntax error ... where I am doing wrong?
    +int ind = (param2 + 7);+
    String str1 = param1.substring(param2,ind);
    String flag;
    if ( (str1.equals("an Integ")) )
    +     flag = "a";+
    else
    +     flag = "b";+
    return (flag);
    param1 and param2 are input parameter in the UDF.
    THanks for your help,
    Abhi
    Edited by: Abhi_1516 on Nov 19, 2009 7:35 PM

Maybe you are looking for