How to use regular expression using pattern and match concept for this scenario?

Hi Guys,
I have a string "We have 7 tutorials for Java, 2 tutorials for Javascript and 1 tutorial for Oracle"
I need to replace the numbers based on the below condition.
if more then 5, replace with many
if less then 5, replace with a few
if it is 1, replace with "only one"
below is my code, I am missing the equating part to replace the numbers could any one of you please help me out fixing this.
private static String REGEX="(\\d+)";
  private static String INPUT="We have 7 tutorials for Java, 2 tutorials for Javascript and 1 tutorial for Oracle";
  //String pattern= "(.*)(\\d+)(.*)";
  private static String REPLACE = "replace with many";
  public static void main(String[] args) {
  // Create a Pattern object
       Pattern r = Pattern.compile(REGEX);
    // Now create matcher object.
       Matcher m = r.matcher(INPUT);
       //replace the value 7 by the replace string
//How to equate the (\\d+)  greater than a number  and use it the below code.
              INPUT = m.replaceAll(REPLACE);
       //Print the final Result;
        System.out.println(INPUT);
Thanks and Regards,

Hi,
Try the following which makes use of  "appendReplacement" instead with the "start" and "end" methods to locate and check the searched "regExp" string before dynamically setting the "replace" string:
String regExp = "\\d+";
String input = "We have 7 tutorials for Java, 2 tutorials for Javascript and 1 tutorial for Oracle";
String replace;
Pattern p = Pattern.compile(regExp);
// get a matcher object
Matcher m = p.matcher(input);
StringBuffer sb = new StringBuffer();
while (m.find()) {
   Integer x = Integer.valueOf(input.substring(m.start(), m.end()));
   replace = (x >= 5) ? "many" : (x == 1) ? "only one" : "few";
   m.appendReplacement(sb, replace);
m.appendTail(sb);
System.out.println(sb.toString());
HTH.
Regards,
Rajen
P.S: Please mark the post as answered/helpful if it resolves your issue for the benefit of all community members.

Similar Messages

  • Using regular expressions to find and replace code.

    Hi! Semi-newbie coder here.
    I'm trying to strip out code from multiple pages, I've tried regular expressions but I'm struggling to understand them. I also need to do it across a LOT of pages, so I need an automated way of doing it.
    The best way I can explain is with an analogy:
    I want to delete any string of characters that start with c, ends with t and includes anything inbetween, so it would pick up "cat, cut, chat, coconut, can do it" whatever appears in the middle of those.
    Except, instead of c and t, I want it to find strings of code starting with <div class="advert" and ending with Vote<br> while picking up everything in between, (including spaces, code, comments, etc.). Then, deletes that whole string including the starting and ending.Is there a regular expression I could use in dreamweaver that could do this? Is there a way to do this at all?

    Let me begin by saying I'm a complete idiot with DW's Reg Ex.   I use Search Specific Tag whenever possible.  See screenshot below.
    Try this on your Current Document to see if it works. Then make a back-up copy of site before attempting it on Entire Local Site as you cannot "Undo" this process.
    Good luck,
    Nancy O.

  • HT1918 How do I change the I-cloud and app password for this device to my husband's existing account?

    Can I change the I-tune username and password for this I-pad to the username and password used on my husband's I-pad?

    You can log out of the account that is used for purchasing content by tapping on the id in Settings > iTunes & App Store and you can then log back in with a different account  - any content that was downloaded by the currently logged in account will remain tied to that account, so only that account will be able to download updates to its apps.
    If you use iTunes Match, automatic downloads or redownload an account's past purchases then you may tie your iPad to that account for 90 days : http://support.apple.com/kb/HT4627 - so you won't be able to any of those three things on a different account until the 90 days have completed
    For iCloud you can remove the existing account via Settings > iCloud > Delete Account

  • How to Use Pattern and Matcher class.

    HI Guys,
    I am just trying to use Pattern and Matcher classes for my requirement.
    My requirement is :- It should allow the numbers from 1-7 followed by a comma(,) again followed by the numbers from
    1-7. For example:- 1,2,3,4,5 or 3,6,1 or 7,1,3 something like that.
    But it should not allow 0,8 and 9. And also it should not allow any Alphabets and special characters except comma(,).
    I have written some thing like..
    Pattern p = Pattern.compile("([1-7])+([\\,])?([1-7])?");
    Is there any problem with this pattern ??
    Please help out..
    I am new to pattern matching concept..
    Thanks and regards
    Sudheer

    ok guys, this is how my code looks like..
    class  PatternTest
         public static void main(String[] args)
              System.out.println("Hello World!");
              String input = args[0];
              Pattern p = Pattern.compile("([1-7]{1},?)+");
              Matcher m = p.matcher(input);
              if(m.find()) {
                   System.out.println("Pattern Found");
              } else {
                   System.out.println("Invalid pattern");
    }if I enter 8,1,3 its accepting and saying Pattern Found..
    Please correct me if I am wrong.
    Actually this is the test code I am presenting here.. I original requirement is..I will be uploading an excel sheets containg 10 columns and n rows.
    In one of my column, I need to test whether the data in that column is between 1-7 or not..If I get a value consisting of numbers other than 1-7..Then I should
    display him the msg..
    Thanks and regards
    Sudheer

  • Pattern and Matcher of Regular Expressions

    Hello All,
    MTMISRVLGLIRDQAISTTFGANAVTDAFWVAFRIPNFLRRLFAEGSFATAFVPVFTEVK
    ETRPHADLRELMARVSGTLGGMLLLITALGLIFTPQLAAVFSDGAATNPEKYGLLVDLLR
    LTFPFLLFVSLTALAGGALNSFQRFAIPALTPVILNLCMIAGALWLAPRLEVPILALGWA
    VLVAGALQLLFQLPALKGIDLLTLPRWGWNHPDVRKVLTLMIPTLFGSSIAQINLMLDTV
    IAARLADGSQSWLSLADRFLELPLGVFGVALGTVILPALARHHVKTDRSAFSGALDWGFR
    TTLLIAMPAMLGLLLLAEPLVATLFQYRQFTAFDTRMTAMSVYGLSFGLPAYAMLKVLLP
    I need some help with the regular expressions in java.
    I have encountered a problem on how to retrieve two strings with Pattern and Matcher.
    I have written this code to match one substring"MTMISRVLGLIRDQ", but I want to match multiple substrings in a string.
    Pattern findstring = Pattern.compile("MTMISRVLGLIRDQ");
    Matcher m = findstring.matcher(S);
    while (m.find())
    outputStream.println("Selected Sequence \"" + m.group() +
    "\" starting at index " + m.start() +
    " and ending at index " m.end() ".");
    Any help would be appreciated.

    Double post: http://forum.java.sun.com/thread.jspa?threadID=726158&tstart=0

  • Regular expressions, using pattern and matcher but not include the pattern

    Hi all
    i have a regular expression but in my matcher it is including the text that is in my regular expression.
    ie
    String str="-------------------stuff===========";
    Pattern mainBody = Pattern.compile("-----(.*?)=====", Pattern.MULTILINE);this matches -------------------stuff=====
    now i expect to get some - in there as i match from the start, but i dont want to have the = in the match. how do i do a match that excludes the matching expressions.

    nevermind, figured it out
    when i do myMatch.group(1) it gives me just my match
    sorry for wasting time :)

  • How to fetch substring using regular expression

    Hi,
    I am new to using regular expression and would like to know some basic details of how to use them in Java.
    I have a String example= "http://www.google.com/foobar.html#*q*=database&aq=f&aqi=g10&fp=c9fe100d9e542c1e" and would like to get the value of "q" parameter (in bold) using regular expression in java.
    For the same example, when we tried using javascript:
    match = example.match("/^http:\/\/(?:(?!mail\.)[^\.]+?\.)?google\.[^\?#]+(?:.*[\?#&](?:as_q|q)=([^&]+))?/i}");
    document.write('
    ' + match);
    We are getting the output as: http://www.google.com/foobar.html#q=database,*database* where the bold text is the value of "q" parameter.
    In Java we are trying to get the value of the q parameter separately or atleast resembles the output given by JavaScript. Please help me resolving this issue.
    Regards
    Praveen

    BalusC wrote:
    Regex is a cumbersome solution for fixed patterns like URL's. String#substring() in combination with String#indexOf would most likely already suffice.I usually agree, although, in this case, finding the exact parameter might be difficult without a small regex, perhaps:
    "\\wq=\\s*"in conjunction with Pattern/Matcher, used similarly to an indexOf() to find the start of the parameter value.
    Winston

  • Pattern matching using Regular expression

    Hi,
    I am working on pattern matching using regular expression. I the table, I have 2 columns A and B
    A has value 'A499BPAU4A32A386KBCZ4C13C41D20E'
    B has value like '*CZ4*M11*7NQ+RDR+RSM-R9A-R9B'
    the requirement is that I have to match the columns of B in A. If there is a value with * sign, this must be present in A like 'CZ4' should exit in string A.
    The issue I am facing is that there are 2 values with * sign. The code works fine for first match (CZ4) but it does not look further as M11 does not exist in A.
    I used the condition
    AND instr(A,substr(REGEXP_SUBSTR(B, '*[^*]{3}'),2) ,1)=0
    First of all, is this possible to match multiple patterns in one condition?
    If yes, please suggest.
    Thanks

    user2544469 wrote:
    Thanks a lot Frank. This query worked wonderful for the test data I have provided however I have some concerns:
    - query doesnot include the column BOOK which is a mandatory check.Sorry, that was my mistake. It was a very easy mistake to make, since you posted sample data where it didn't matter. Instead of doing a cross-join between vn and got_must_have_cnt, do an inner join, using book. That means book will have to be in got_must_have_cnt, and all the sub-queries from which it descends. Look for comments that say "March 22".
    If you want to treat '+' in test_cat.codes as '*', then the simplest thing is probably just to use REPLACE, so that when the table has '+', you use '*' instead.
    WITH     got_token_cnt     AS
         SELECT     cat
         ,     book                                        -- Added March 22
         ,     REPLACE (codes, '+', '*') AS codes                    -- If desired.  Changed March 22
         ,     LENGTH (codes) - LENGTH ( TRANSLATE ( codes
                                                       , 'x*+-'
                                      , 'x'
                             ) AS token_cnt
         FROM    test_cat
    ,     cntr     AS
         SELECT     LEVEL     AS n
         FROM     (  SELECT  MAX (token_cnt)     AS max_token_cnt
                 FROM        got_token_cnt
         CONNECT BY     LEVEL     <= max_token_cnt
    ,     got_tokens     AS
         SELECT     t.cat
         ,     t.book                                        -- Added March 22
         ,     REGEXP_SUBSTR ( t.codes
                         , '[*+-]'
                         , 1
                         , c.n
                         )          AS token_type
         ,     SUBSTR ( REGEXP_SUBSTR ( t.codes
                                       , '[*+-][^*+-]*'
                               , 1
                               , c.n
                   , 2
                   )          AS token
         FROM     got_token_cnt     t
         JOIN     cntr          c  ON     c.n     <= t.token_cnt
    ,     got_must_have_cnt     AS
         SELECT       cat, book                                   -- Changed March 22
         ,       COUNT (CASE WHEN token_type = '*' THEN 1 END) AS must_have_cnt
         FROM       got_tokens
         GROUP BY  cat, book                                   -- Changed March 22
    SELECT       mh.cat
    ,       vn.vn_no
    FROM       got_must_have_cnt     mh
    JOIN                    vn  ON  mh.book     = vn.book               -- Changed March 22
    LEFT OUTER JOIN      got_tokens     gt  ON     mh.cat                  = gt.cat
                                     AND INSTR (vn.codes, gt.token) > 1
    GROUP BY  mh.cat
    ,            mh.must_have_cnt
    ,            vn.vn_no
    HAVING       COUNT (CASE WHEN gt.token_type = '*' THEN 1 END)     = mh.must_have_cnt
    AND       COUNT (CASE WHEN gt.token_type = '-' THEN 1 END)     = 0
    ORDER BY  mh.cat
    - query is very slow with 60000 records in vn table. Cost is somewhere around 36000.See these threads:
    When your query takes too long ...
    HOW TO: Post a SQL statement tuning request - template posting
    Relational databases were designed to have (at most) one piece of information in each column. If you decide to have multiple items in the same column (as you have a variable number of tokens in the codes column), don't be surprised if that makes things slower and more complicated. Most of the query I posted, and perhaps most of the time needed, is jsut to normalize the data. If you stored the data in a narmalized form, perhaps something like got_tokens, then you wouldn't need the first 3 sub-queries that I posted.
    Edited by: Frank Kulash on Mar 22, 2011 12:04 PM

  • One for the Tekkies: How to get this output using REGULAR EXPRESSIONS?

    How to get the below output using REGULAR EXPRESSIONS??
    SQL> ed
    Wrote file afiedt.buf
      1* CREATE TABLE cus___addresses    (full_address                   VARCHAR2(200 BYTE))
    SQL> /
    Table created.
    SQL> PROMPT Address Format is: House #/Housename,  street,  City, Zip Code, COUNTRY
    House #/Housename,  street,  City, Zip Code, COUNTRY
    SQL> INSERT INTO cus___addresses VALUES('1, 3rd street, Lansing, MI 49001, USA');
    1 row created.
    SQL> INSERT INTO cus___addresses VALUES('3B, fifth street, Clinton, OK 74103, USA');
    1 row created.
    SQL> INSERT INTO cus___addresses VALUES('Rose Villa, Stanton Grove, Murray, TN 37183, USA');
    1 row created.
    SQL> SELECT * FROM cus___addresses;
    FULL_ADDRESS
    1, 3rd street, Lansing, MI 49001, USA
    3B, fifth street, Clinton, OK 74103, USA
    Rose Villa, Stanton Grove, Murray, TN 37183, USA
    SQL> The REG EXP query shouLd output the ZIP codes: i.e. 49001, 74103, 37183 in 3 rows.Edited by: user12240205 on Jun 18, 2012 3:19 AM

    Hi,
    user12240205 wrote:
    ... Frank, ʃʃp's method, I understand. But your method, although correct, I find it difficult to understand.
    Could you explain how you did this?? What does '.*(\d{5})\D*' and '\1' mean???
    Your method is better because it uses only ONE reg expression function. ʃʃp's uses 2.In Oracle 10.2 (I believe) and higher, '\d' is equivalent to '[[:digit:]]', and '\D' is equivalent to '[^[:digit:]]'. I find '\d' and '\D' easier to type, but there's nothing wrong with using '[[:digit:]]' and '[^[:digit:]]'.
    '.*' means "0 or more of any character".
    '\D*' means "0 or more non-digits".
    The whole expression, '.*(\d{5})\D*' means:
    a. 0 or more characters (any characters)
    b. 5 digits
    c. 0 or more non-digits.
    '\1' is a Backreference . It means the sub-string that matched the pattern after the 1st '(', up to (but not including) its matching ')'. In this case, that means the sub-string that matched '\d{5}', or b. using the explanation immediately above.
    So the entire REGEXP_REPLACE call means "When you see a sub-string consisting of a., follwed immediately by b., followed immedately by c., replace that sub-string with b. alone."

  • How to define a regular expression using  regular expressions

    Hi,
    I am looking for some regular expression pattern which will identify a regular expression.
    Also, is it possible to know how does the compile method of Pattern class in java.util.regex package work when it is given a String containing a regex. ie. is there any mechanism to validate regular expression using regular expression pattern.
    Regards,
    Abhisek

    I am looking for some regular expression pattern which will identify a regular
    expression. Also, is it possible to know how does the compile method of
    Pattern class in java.util.regex package work when it is given a String
    containing a regex. ie. is there any mechanism to validate regular
    expression using regular expression pattern.It is impossble to recognize an (in)valid regular expression string using a
    regular expression. Google for 'pumping lemma' for a formal proof.
    kind regards,
    Jos

  • How to use regular expression to delete a character?

    Hello,
    I have a query,
    select partition_name from dba_tab_partitions where table_owner='xxx'and num_rows <>0 and table_name = 'xxx';
    P5
    P6
    P7
    P12
    P13
    P14
    P17
    P18
    P19
    P20
    P24
    How can I use regular expression in above SQL query to get result without letter 'P', like..
    5
    6
    7
    12
    13
    14
    17
    18
    19
    20
    24
    thank you

    I find answer...
    select regexp_replace(partition_name,'P','')
    thanks anyway

  • How to use regular expressions to generate test data ?

    Hi
    Someone can help me on what I have to do in order to create test data with regular expressions ?
    For example, I want to introduce a random telephone number (XXX-XXXX) in the phone number Form Field, I want to create the phone number using regular expressions in order to test different values in each playback of the script.
    I don't want to use VB or vbscript in e-tester, I'm just trying to do this with e-load nav editor and e-load
    Thanks a lot

    Hi and thanks for your answer!, it's a great trick ^_^
    I'm doing a research on how to improve the execution speed of the scripts in e-load, so actually I'm trying to avoid the use of databanks and VB code also.
    I was expecting that maybe e-load, e-load nav editor or e-tester can automatically generate test data via Regular Expressions. Someone Knows if this is possible ?
    Also can anyone tell me what the option "Automatically Generated (complex)" means ? I think that this will help me a lot
    *you can find this option in e-load Nav Editor when you select a parameter in the tree view, then go to the  "type" listbox in the properties pane, there you will find this option and some more options like :"Databanked variable", "Custom Dynamic Value", "Function".. etc.
    Thanks again

  • How to Validate this using Regular Expressions

    Hi All,
    I have following types of Mail IDs, Each is a String.
    It may be either of the Following:
    [email protected]
    or
    Ameer<[email protected]>
    Then How to validate using the Regular Expressions.

    use this regex.. might need to convert it from perl regex flavor:
    (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
    )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
    \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
    ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
    \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
    31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
    ](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+
    (?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:
    (?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
    |(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)
    ?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\
    r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
    \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)
    ?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t]
    )*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[
    \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*
    )(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
    )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)
    *:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+
    |\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r
    \n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
    \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t
    ]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031
    ]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](
    ?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?
    :(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?
    :\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?
    :(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
    [ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\]
    \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|
    \\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>
    @,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"
    (?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t]
    )*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
    ".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?
    :[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[
    \]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-
    \031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(
    ?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;
    :\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([
    ^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\"
    .\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\
    ]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\
    [\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\
    r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
    \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]
    |\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \0
    00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\
    .|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,
    ;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?
    :[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*
    (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
    \[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[
    ^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]
    ]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(
    ?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
    ".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(
    ?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[
    \["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t
    ])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t
    ])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?
    :\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|
    \Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:
    [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\
    ]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)
    ?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["
    ()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)
    ?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>
    @,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[
    \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,
    ;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t]
    )*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
    ".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?
    (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
    \[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:
    \r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[
    "()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])
    *))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])
    +|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\
    .(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
    |(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(
    ?:\r\n)?[ \t])*))*)?;\s*)

  • Find text using regular expression and add highlight annotation

    Hi Friends
                       Is it possible to find text using regular expression and add highlight annotation using plugin

    A plugin can use the PDWordFinder to get a list of the words on a page, and their location. That's all that the API offers for searching. Of course, you can use a regular expression library to work with that word list.

  • How to Capture Multiple Line String using Regular Expression?

    Hi, 
    I have a simple program like this:
    What I want to accomplish is to capture everything between >>start and >>end using a single Match Regular Expression node. It seems that setting multiple? to True or False does not help.
    I am using LabVIEW 2012.
    If it is impossible to capture it using a single node, that is fine. But I want to make sure that I can make full use of this node without combining serveral others.
    Thank you!
    TailOfGon
    Certified LabVIEW Architect 2013
    Solved!
    Go to Solution.

    Thank you for the fast response! Your solution worked in the example case
    After I saw your post, I was finally able to step forward. But I still wanted to make use of dot notation due to the limitation of characters that match with \w. 
    I made some more modification to your regular expression then now it seems working for all characters:
    >>start((?:\s|.)*)>>end
    Thanks!
    TailOfGon
    Certified LabVIEW Architect 2013

Maybe you are looking for

  • Accessing images outside the application

    Hello! I've been developing a web app as a part of my learning of JSP and now have stumbled onto a problem I haven't been able to Google out yet. Maybe I'm missing something, but here goes... The app I'm developing is in Croatian and I've had a first

  • When i am trying to download a free apps it ask me about payment info

    pls let me know why my new i phone 4s making me problem when i am trying to download free apps like facebook skype so pls solve the problem on urgent basis

  • Remote metadata entry?

    I recently finished scanning a few hundred slides for my dad and have loaded the scans into Aperture for cropping, color correction, and other edits. Is there a way that I could send him reduced-side versions of the images, have him add metadata, and

  • Uploading a slideshow to Mobile Me

    I spent hours preparing a slideshow and when I uploaded the album to Mobile Me, the slideshow did not upload as I had designed it. It just looks plain, no music and no special effects. How do I upload the slideshow? That information was not in the on

  • I can't find my subscription under my account

    I want to cancel my subscription, but I can't find the plan under my account.