Converting String Characters into Regular Expression Automatically?

Hi guys.... is there any program or sample coding which is available to convert string characters into regular expression automatically when the program is run?
Example:
String Character Input: fnffffffffffnnnnnnnnnffffffnnfnnnnnnnnnfnnfnfnfffnfnfnfnfnfnnnnd
When the program runs, it automatically convert into this :
Regular Expression Output: f*d

hey guys.... i am sorry for not providing all the information that you guys need as i was rushing off to urgent meeting... for my string characters i only have a to n.. all these characters are collected from sensors and stored inside database... from many demos i have done... i found out that every demo has different strings of characters collected and these string of characters will not match with the regular expressions that i had created due to several unwanted inputs and stuff... i have a lot of different types of plan activities and therefore a lot of regular expressions.... if i put [a-z|0-9]*... it will capture all characters but in the same time it will be showing 1 plan only.... therefore, i am finding ways to get the strings i collected and let it form into regular expression by themselves in the program so that it will appear as different plans as output with comparing with the regular expression that i had created.... is there any way to do so?
please post again if there is any questions u are still not familiar with... thank you...

Similar Messages

  • How to create a list of string if a regular expression is given ?

    Hi folks,
    I have a regular expression say abcd[a-z]\\\.[0-9] . ( please ignore one '\')
    For this string i know that
    following string matches successfully
    1. abca.0
    2. abcb.1
    3. abcz.9 ......etc n number of combination are possible.
    is there any algorithm which will create some randomn strings from a regular expression.
    input to algorithm : some string pattern
    output to algorithm : some matching strings ( can be a single or an array of matching strings)
    Thanks in advance..
    Sethu
    Edited by: Sethumadhavan on Apr 16, 2008 6:32 AM

    Can u please give little more explanation...
    If i get some some values i can exit with the values ... and from the values i got i can ignore the duplicates ...
    But i am not getting the basic algorithm to get list of strings.....( DFA? or NFA?)
    thanks
    sethu

  • Changeparticular characters in a string by using regular expressions ...

    Hello Everyone,
    I am trying to write a function by using oracles regular expression function REGEXP_REPLACE but I could not succed till now.
    My problem as follows, I have a text in a column for example let say 'sdfsdf Sdfdfs Sdfd' I want replace all s and S characters with X and make the text look like 'XdfXdf XdfdfX Xdfd'.
    Is it possible by using regular expressions in oracle ?
    Can you give me some clues ?
    Thank you

    SSU wrote:
    Hello Everyone,
    I am trying to write a function by using oracles regular expression function REGEXP_REPLACE but I could not succed till now.
    My problem as follows, I have a text in a column for example let say 'sdfsdf Sdfdfs Sdfd' I want replace all s and S characters with X and make the text look like 'XdfXdf XdfdfX Xdfd'.
    Is it possible by using regular expressions in oracle ?
    Can you give me some clues ?
    Thank you
    SQL> SELECT
      2  regexp_replace('sdfsdf Sdfdfs Sdfd','s|S','X') from dual;
    REGEXP_REPLACE('SD
    XdfXdf XdfdfX XdfdRegards,
    Achyut

  • Splitting html ul tags and their content into string arrays using regular expression

    <ul data-role="listview" data-filter="true" data-inset="true">
    <li data-role="list-divider"></li><li><a href="#"><h3>
    my title
    </h3><p><strong></strong></p></a></li>
    </ul>
    <ul data-role="listview" data-filter="true" data-inset="true">
    <li data-role="list-divider"></li><li>test.</li>
    </ul>
    I need to be able to slip this html into two arrays hold the entire <ul></ul> tag. Please help.
    Thanks.

    Hi friend.
    This forum is to discuss problems of C# development. Your question is not related to the topic of this forum.
    You'll need to post it in the dedicated Archived Forums N-R  > Regular Expressions
     for better support. Thanks for understanding.
    Best Regards,
    Kristin

  • Need advice on negating a whole string line with regular expression

    Hi All,
    I am not able to ignore / get rid of the following line even though my Java 6 (Windows XP) String Pattern matching has not taken cater for it:
    *% Cleared: 61%*
    Below is the existing Java String Pattern matching in the simple program:
    Pattern pattern = Pattern.compile("(^.*[A-Z][a-z]*){1,2} \\d{0,4}/?\\d{0,4} ([A-Z][a-z]*){1,2} St|Rd|Av|Sq|Cl|Pl|Cr|Gr|Dr|Hwy|Pde|Wy|La \\d br [h|u|t] \\$\\d+,\\d+|\\$\\d*\\,\\d+,\\d+ ([A-Z][a-z]*){1,}.*$");This pattern is working for valid strings.
    The following pattern has included "^(?!.*\.\.).*$" into the existing one but had no luck still:
    Pattern pattern = Pattern.compile("^(?!.*\.\.).*$|((^.*[A-Z][a-z]*){1,2} \\d{0,4}/?\\d{0,4} ([A-Z][a-z]*){1,2} St|Rd|Av|Sq|Cl|Pl|Cr|Gr|Dr|Hwy|Pde|Wy|La \\d br [h|u|t] \\$\\d+,\\d+|\\$\\d*\\,\\d+,\\d+ ([A-Z][a-z]*){1,}.*$)");This picked up other rubbish including "*% Cleared: 61%*".
    I am looking for a single regular expression that applies to the whole line.
    I am quite new to regular expression but has read through Regular Expressions Cookbook (Oreilly - 2009) and is still not familiar with advance functions such as lookahead / lookbehind...
    Your assistance would be appreciated.
    Thanks,
    Jack

    Hi Winston,
    I am still digesting the material from the regular expression book and will take sometime to become proficient with it.
    It seems that using groupCount() to eliminate the unwanted text does not work in this case, since all the lines returned the same value. Ie 3 posted earlier. This may be because the patterns are complex and only a few were grouped together. Otherwise, could you provide an example using the string posted as opposed to a hyperthetic one. In the meantime, at least one solution have been found by defining an additional special pattern “\\A[^%].*\\Z”, before combining / intersecting both existing and the new special pattern to get the best of both world. Another approach that should also work is to evaluate the size of String.split() and only accept those lines with a minimum number of tokens.
    Anyhow, I have come a crossed another minor stumbling block in the mean time with the following line, where some hidden characters is preventing the existing pattern from reading it:
    o;?Mervan Bay 40 Boyde St 7 br t $250,000 X West Park AE
    Below is the existing regular expression that works for other lines with the same pattern but not for special hidden characters such as “o;?”:
    \\A([A-Z][a-z]*){1,2} [0-9]{0,4}/?[0-9]{0,4}-?[0-9]{0,4} ([A-Z][a-z]*){1,2} St|Rd|Av|Sq|Cl|Pl|Cr|Gr|Dr|Hwy|Pde|Wy|La [0-9] br [h|u|t] \\$\\d+,\\d+|\\$\\d*\\,\\d+,\\d+ ([A-Z][a-z]*){1,}\\ZIs it possible to come up with a regular expression to ignore them so that this line could be picked up? Would also like to know whether I could combine both the special pattern “\\A[^%].*\\Z” with existing one as opposed to using 2 separate patterns altogether?
    Many thanks,
    Jack

  • String validation without regular expressions

    Hello all
    I'm facing a little problem, basically i have to make a method that validates an input String "a name"
    Numbers and symbols are not allowed, but white spaces are.
    The method has to be implemented without the use of JFormattedTextField or regular expressions.
    What i'm doing right now is this:
    public boolean validate(String name){
       char[] arr=name.toCharArray();
        for(Char c:arr){
          if(!Character.isLetter(c)){
           return false;
      return true;
    }That isLetter() method is very useful but it sees the white spaces are "non letters".
    I am a bit lost at this point, i'm trying a lot of methods of String and Character but nothing seems to work
    do you have any advice?
    Thx

    enrico wrote:
    That isLetter() method is very useful but it sees the white spaces are "non letters".
    I am a bit lost at this point, i'm trying a lot of methods of String and Character but nothing seems to work
    do you have any advice?Yes: don't try to do it all in one expression. 'If' statements allow you to use '&&' and '||' to connect expressions, so use them.
    Second: Work out what you want to do BEFORE you start programming.
    In this case, you need to know exactly which characters you want to allow, +and when+ (see baftos' examples above).
    Third:for(Char c:arr){is meaningless (unless you've defined a class called 'Char').
    Accuracy is important.
    Winston

  • How to use special characters in regular expression

    HI all, I am new to regular expression.
    Can any one please tell me the regular expression for characters which are used in regular expression like " [({. tetc.Is there any particular expression to prefix before using these characters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Expression:
    < td .*? bgcolor = \" ( [^ \" ] +) \" \\s* .*? > ( .+? ) </td>
    It will search for expression starting with <td ,
    .*? means any characters zero or more than one,
    then it will find bgcolor = , then literal \"... \(any char) is that specific char
    [ ^ \" ] any character but not literal \",this means there has to be something between ".... " if empty then wont match ,+ is 1 or more times
    Then again literal \ " , after that \\s* means zero or more num of spaces,
    then again , .*? means any characters zero or more than one,
    it will search for literal > , again any chars . * ?
    Finally </td> will be searched.....!!
    So all expressions having this particular structure will be
    matched.
    Output :
    <td align="left" valign="top" bgcolor="ffffff" width="177">bla bla bla</td>

  • String splitting with regular expressions

    Hello everyone
    I need some help in splitting the string using regular expressions
    Suppose my String is : abc def "ghi jkl mno" pqr stu
    after splitting the reulsting string array should contain the elements
    abc
    def
    ghi jkl mno
    pqr
    stu
    what my regular expression should be

    Since this is essentially the same as parsing CSV data, you might want to download a CSV parser and adapt it to your need. But if you want to use regexes, split() is not the way to go. This approach should work for your sample data:
    Pattern p = Pattern.compile("\"[^\"]*+\"|\\S+");
    Matcher m = p.matcher(input);
    while (m.find())
      System.out.println(m.group());
    }

  • String replace using regular expressions

    I'm not very good at regular expressions, but I would like my script to replace
         <a href="somepage.html">
    by
    <a href="event:somepage">
    How do I do this?  Thanks in advance!

    Replacing a string that matches a certain pattern with another string is one of the more common RegEx tasks. There is documentation on using them here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=12_Using_Regular_Expressions_01.ht ml
    hth,
    matt horn
    flex docs

  • How to convert String array into int.

    void getSoldSms(Vector vecSoldSms)
         String str[]=new String[vecSoldSms.size()];
         String words[]=new String[str.length]; // String array
              for(int i=0;i< vecSoldSms.size();i++)
                   str=(String)vecSoldSms.get(i);
              }               //End for
              for(int i=0;i<str.length;i++)
              words = str[i].split("\\|\\|");
              System.out.println();
              for(int j=0;j<1;j++)     
              int count[str.length]=Integer.parseInt(words[i]);
              System.out.print(count[j]*advance_count);
              } // end inner for loop
              }          //End for
         }          //End function getSoldSms
    how do i convert words which is a string array into int type. i kno string can be converted into int using interger.parseint. but wat abt string arrays??? plz help me out with the above code.

    i did tht its still giving the same errorFor Heaven's sake, what about taking a second to try to understand the code you're copying first? If you really can't fix the error yourself, you have a more serious problem than just convertingStrings to ints.
    And if you want { "1", "2", "3" } to be 123:
    StringBuffer b = new StringBuffer();
    for (int i = 0; i < array.length; i++) {
      b.append(array);
    int result = Integer.parseIn(b.toString());

  • String extract using regular expression

    Hi
    I have text like this "<a>45</a><ct>Hi</ct><R>45 85</R><H>Here</H>" .I want to extract using regular expression or any techniques the text between <R> and </R> also need to replace the space with pipe between 45 and 85 like "45|85"
    Edited by: vishnu prakash on Mar 2, 2012 4:42 AM

    Hi,
    Here's one way:
    REPLACE ( REGEXP_REPLACE ( txt
                    , '.*<R>(.*)</R>.*'
                    , '\1'
         , '|'
         )This assumes there is only one <R> tag in txt.
    Always say which version of Oracle you're using. The expression above will work in Oralce 10 and up, but starting in Oracle 11 you can use REGEXP_SUBSTR rather than the less intuitive REGEXP_REPLACE.
    Edited by: Frank Kulash on Mar 2, 2012 7:48 AM

  • Can you parse an array of string characters into separate arrays?

    Hello,
    I didn't see anything directly related to my question, so I'll go ahead and post it.  I'm looking to parse an array of hex characters into three separate arrays for parallel Color to RGB conversion in LabView.  Ideally, after importing an image, I would have liked to use the Color to RGB conversion for the 24-bit pixmap (in hex digit format), but apparently, you can only do this for single number conversions...not arrays.  Another way is what I have mentioned above, which would be to parse each element's red, green, and blue # into three separate arrays as shown below:
    Original Array:   aa11ff     225599
                              cc4488   bbcc11
    Array 1: aa  22
                 cc   bb
    Array 2: 11   55
                  44   cc
    Array 3:  ff    99
                  88   11
    I could then do a parallel conversion of these arrays from hex to numeric and get the desired result.  However, I'm having trouble finding a function that will do this.  So I would like to ask if a function like this does exist and if so, what is it?  I should note that I'm trying to avoid using two while loops because of time constraints (using the program for in-situ measurements), and we do not own, nor are we looking to purchase the $$$ vision/video package that NI makes.

    Nevermind.  I found an adequate way.

  • HTML Editor - converting "special characters" into entities

    Hi everyone,
    I'm currently in the middle of formatting my wife's novel into 'clean' html so I can use Calibre to create a well formatted epub/mobi/etc.
    I've read that TextMate on Mac includes a function to "Convert Selection to Entities excluding Tags".  In other words it will replace all special characters (ellipses, copyright sign, etc) with the html entities.
    I'm currently using Kate and I can't seem to find anything similar.  Is anyone aware of any linux editors with the same function?
    Thanks for the help!

    ctarwater wrote:Encoding is already UTF-8 but I'm trying to make these docs as "universal" as possible and I've read that little things like replacing quotation marks and other symbols with their html entities is a good step in that direction.
    In situations with multiple encodings this might be the case, but the XML spec requires UTF‐8 support at minimum and defaults to it when the encoding is not declared. All XML parsers can deal with UTF‐8.
    In fact, replacing UTF‐8 characters with entities is less portable in XML. This is because the available entities are defined by the doctype, and XML only supports five by default (&lt;, &gt;, &quot;, &amp;, and &apos;). Things like &hellip; are defined in the HTML and XHTML doctypes, but not in other dialects of XML. This used to bite RSS pretty hard (probably still does), because people assumed the entities were available everywhere when they’re really not. EPUB and Mobi are based on XHTML, but other formats might use other XML dialects.

  • Convert string Column into set or Rows.

    Hi,
    I have a difficult time converting a string column in the source table to be spitted and insert them as individual rows in target table. The source sting is separated by "-" character. And the source sting can have any number of "-" which may result in any number of out put rows.
    e.g. "- IL - NY - NJ - KY - TX" "RAY" should look like
    RAY IL
    RAY NY
    RAY NJ
    RAY KY
    RAY TX
    in the target table.
    Thanks,
    Ashvin.
    Edited by: user591315 on Mar 13, 2009 8:03 AM

    This is working.
    All you need to do in owb is pull the table function operator , config it take a ref-cursor and also give the attribute names that are declared in the type record to each of the out put variables in the table function operator.(in this case-8 variables).
    Thanks,
    Ashvin.
    CREATE OR REPLACE
    type RDW.STAFF_MEMBER_BREAKDOWN_RECORD is object
    ( survey_i_id number,
    survey_id number,
    client number,
    company number,
    csg number,
    contact number,
    pred_mode_type number,
    pred_mode_string varchar2(2000));
    CREATE OR REPLACE
    type RDW.STAFF_MEMBER_BREAKDOWN_TABLE
    is table of staff_member_breakdown_record;
    CREATE OR REPLACE package RDW.refcur_pkg
    as
    type staff_teams_cur_type is ref cursor;
    end refcur_pkg;
    CREATE OR REPLACE function RDW.parse_teams
    (staff_teams_cur refcur_pkg.staff_teams_cur_type)
    return staff_member_breakdown_table
    pipelined
    is
    v_survey_i_id NUMBER;
    v_survey_id NUMBER;
    v_client NUMBER;
    v_company NUMBER;
    v_csg NUMBER;
    v_contact NUMBER;
    v_pred_mode_type NUMBER;
    v_team_members_r VARCHAR2(2000);
    v_team_members VARCHAR2(2000);
    cnt NUMBER;
    exit_flag NUMBER;
    begin
    loop
    fetch staff_teams_cur into v_survey_i_id,v_survey_id ,v_client,v_company,v_csg,v_contact,v_pred_mode_type,v_team_members;
    exit when staff_teams_cur%notfound;
    exit_flag := 0;
    v_team_members_r := ltrim(v_team_members,'#') ;
    loop
    cnt := instr( v_team_members_r, '#' );
    if ( cnt > 0 )
    then
    v_team_members := substr(v_team_members_r,1,instr(v_team_members_r,'#')-1);
    v_team_members_r := substr(v_team_members_r,instr(v_team_members_r,'#')+1);
    else
    v_team_members := v_team_members_r;
    exit_flag := 1;
    end if;
    pipe row (staff_member_breakdown_record(
    to_number(v_survey_i_id),v_survey_id ,v_client,v_company,v_csg,v_contact,v_pred_mode_type, v_team_members));
    exit when exit_flag = 1;
    end loop;
    end loop;
    end parse_teams;
    /

  • How do I convert inputted characters into Uppercase in JDeveloper 11.1.2?

    Hi Everyone:
    Back in 2007 when we were trying to figure this out, Steven Davelaar gave me the solution to use the Custom Properties as found here in this post.....
    Can I convert data inputted to Uppercase by using a EO/VO domain?
    It has been working for us excellently. I have been playing around in JDeveloper 11.1.2 and trying to implement the same thing in our reusable business components .jar file, but they have changed the Custom Properties so much, I am not sure what to do. I cannot seem to type in "Uppercase" in the Property section, and then "true" in the value section with the add dialogue box that is now supplied. I appears that the Custom Properties code is going into the ModelBundle file as opposed to the .xml file.
    Is there a way to do this in JDev 11.1.2? Yes, I know you could tell me to post this to the JDev forum, but in the last 2 weeks I have had 2 carefully researched threads in that forum and have gotten NO useful replies even after bringing them to the front of the forum several times. Frustrating waste of my time.
    I am hoping since Steven knew how to do this before, that he will possibly know how to do it again.
    Do I have to manually edit the XML file? Is this even possible in 11.1.2?
    Thank you so much in advance.
    Mary
    UofW

    Hi All:
    I have figured out my problem. When in the new 11.1.2 Custom Properties tab of an attribute, an individual must click on the arrow next to the "+" sign and choose "Non-translatable Property". This then fills in the Property column with the word "Property" and the Value column with the word "Value".
    The trick is to double click on the word Property which makes it editable and add "Uppercase", and double click on the word Value replacing it with "true" in order to translate to uppercase as described in the above mentioned post.
    I hope that is helpful to someone.
    Mary
    UofW

Maybe you are looking for

  • Problem about Non-blocking socket's read and write

    my aim is:when I open a socketchannel,I can use this socket which can continue send and get messages!(for example:open a socket,send a loging message,server echo,if passed,use the same socket sending other message,get echo messages.... Here is proble

  • Reg: calling selection screen from the second list

    Hi all, How can we call the selection screen from the second screen. Can any one help me to solve this problem.

  • Item Category not allowing matchcode selection

    Hi, I am in the process of configuration of third party shippments, when I test it I try to manually change the item category on the sales order, I have maintained trnsc VOV4 and the matchcode shows the options of TAN and YB1 (which I set for the typ

  • Quicktime goes to "slow motion"

    Hi all, I recently switched to the iMac and can't quite deal with all the tweaks and quirks of it so I would love all the help I could get. When I watch videos using quicktime (either from an external drive or from the Internet) the clip sometimes go

  • CS3 crashing when working with vertical orientation images

    My CS3 has been crashing every single time I work with a portrait style image... I don't have any other issues except this one. I can open the raw file and edit it, but when I create a new canvas and move the file over into the new canvas it freezes