Using regular expressions to get a customized output

Hi,
I have a string/varchar variable with the data ',a,b,c,' in it.
I want the display as follows:
a
b
c
I would like to get the similar output using regular expressions.
How do I get this output using REGEXP_REPLACE or REGEXP_SUBSTR?
Please do the needful.
Thanks & Regards,
Rakshit

I remember that, however if we look closer, that one has a little flaw: The 2nd row should be null, because ",," indicates an empy field. The MODEL clause solution works just fine in this case:
with t as (select 'aaaa,,bbbb,cccc,dddd,eeee,ffff' col1 from dual)
-- end of sample data
SELECT col_new
  FROM t
MODEL
   PARTITION BY (ROWNUM rn)
   DIMENSION BY (0 dim)
   MEASURES(col1, col1 col_new)
   RULES ITERATE(99) UNTIL (ITERATION_NUMBER = LENGTH(REGEXP_REPLACE(col1[0], '[^,]')))
                (col_new[ITERATION_NUMBER] = REPLACE(REGEXP_SUBSTR(col1[0], '(^|,)[^,]*', 1, ITERATION_NUMBER+1), ','))
COL_NEW                                                                                                                                                                  
aaaa                                                                                                                                                                     
bbbb                                                                                                                                                                     
cccc                                                                                                                                                                     
dddd                                                                                                                                                                     
eeee
ffff
7 Zeilen ausgewählt.Update: I had this nagging feeling that I missed something, and there it was. If you want to see what the problem with my solution is, change the example to
with t as (select ',aaaa,,bbbb,cccc,dddd,eeee,ffff' col1 from dual)So I went back and tried to fix BlueShadows approach. Here it is:
with t as (select 'aaaa,,bbbb,cccc,dddd,eeee,ffff' txt from dual)
-- end of sample data
SELECT REPLACE(REGEXP_SUBSTR(',' || txt, ',[^,]*', 1, level), ',') col_new
  FROM t
  CONNECT BY level <= length(regexp_replace(txt,'[^,]*'))+1
;C.

Similar Messages

  • 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 get year value using regular expression

    Hi,
    I have a different format of date such as 2004-01-03, 2003/01, 05/06/2005, 06-05-2007
    How can I get only the year value using regular expression? The year value is always in 4 digits
    Thanks in advance

    sabre150 wrote:
    JosAH wrote:
    \d{4}Is this the Jos I knew who poured scorn on anything to do with regex? Is this the Jos I knew who said that the 'pimping lemon' stopped regex being of any real use?It wasn't me; honest, I'm innocent: one of my parrots walked over my keyboard; I wouldn't be able to type such nonsense; naughty parrot! No cookie!
    kind regards,
    Jos
    ps. regexes can only survive the baby-pumping-lemma; they all die a horrible death with the real-men-pumping lemma! So there.

  • Help in query using regular expression

    HI,
    I need a help to get the below output using regular expression query. Please help me.
    SELECT REGEXP_SUBSTR ('PWRPKG(P/W+P/L+CC)', '[^+]+', 1, lvl) val, lvl
    FROM DUAL,(SELECT LEVEL lvl FROM DUAL
    CONNECT BY LEVEL <=(SELECT MAX ( LENGTH ('PWRPKG(P/W+P/L+CC)') - LENGTH (REPLACE ('PWRPKG(P/W+P/L+CC)','+',NULL))+ 1) FROM DUAL));
    I need the output as
    correct result:
    ==============
    val lvl
    P/W 1
    P/L 2
    CC 3
    But i tried the above it is not coming the above result. Please help me where i did a mistake.
    Thanks in advance

    Frank gave you a solution in your other thread. You could simplify it if you are on 11g:
    SQL> select * from table_x
      2  /
    TXT
    TECHPKG(INTELLI CC+FRT SONAR)
    PWRPKG(P/W+P/L+CC)
    select  txt,
            regexp_substr(
                          txt,
                          '(.*\()*([^+)]+)',
                          1,
                          column_value,
                          null,
                          2
                         ) element,
            column_value element_number
      from  table_x,
            table(
                  cast(
                       multiset(
                                select  level
                                  from  dual
                                  connect by level <= regexp_count(txt,'\+') + 1
                       as sys.OdciNumberList
      order by rowid,
               column_value
    TXT                                      ELEMENT    ELEMENT_NUMBER
    TECHPKG(INTELLI CC+FRT SONAR)            INTELLI CC              1
    TECHPKG(INTELLI CC+FRT SONAR)            FRT SONAR               2
    PWRPKG(P/W+P/L+CC)                       P/W                     1
    PWRPKG(P/W+P/L+CC)                       P/L                     2
    PWRPKG(P/W+P/L+CC)                       CC                      3
    SQL>  SY.

  • 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

  • Item Validation using Regular Expression

    Hi,
    I am trying to apply a Validation to a text field item, with the type as Regular Expression.
    The text input into the field should be in a HH:MM:SS format, ie 05:30:00 (for 5:30am).
    The text I am placing in the 'Validation Expression 2' box is:
    [0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]
    This doesn't seem to work and I get an error message when I enter text in the correct format.
    I have even tried to use other comparisons, for example:
    or
    .{8}
    but these still give me an error message.
    Anyone have any ideas?

    Thanks for your help Flavio, the Regular Expression tool is really helpful.
    When I use this tool to compare strings with my regular expression, I get output = TRUE, which means I'm getting it right, but for some reason when I copy the same Regular Expression syntax into APEX, it doesn't work.
    I try to input correct strings into the field that is validated by the Reg Expr, but it still gives me an error.
    It seems to be something I am doing wrong within the application, but I can't figure out what I'm missing.
    I am creating an Item Level Validation with details:
    Type: Regular Expression
    Validation Expression 1: P23_BUS_DAY_COVERAGE_START
    Validation Expression 2: ^(([0-1][0-9])|(2[0-3])):[0-5][0-9]:[0-5][0-9]$
    Has anyone had similar problems using regualr expression validation in APEX?

  • Regular expression not giving the required output.

    Hi , I have msgs that look like this :
    dear john smith you Bought 500 shares of Nile Cotton Ginning at 14.9 L.E On 21/01/10
    Im using the Regular expression to get 4 substrings of this msg
    1-Bought|Sold
    2-Quantity of shares (ex: 500)
    3-Name of the stock (ex:Nile Cotton Ginning)
    4-price (ex:14.9)
    Here is my code , but the output returns the whole msg back :
    select SMSID,SMSNO,CUSTOMERACCOUNTID,SENDDATE,ENTRYDATE,
    regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\1')),'(watheeqa)') buy_sell
    regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\2')),'(watheeqa)') amount ,
    regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\3')),'(watheeqa)') company ,
    regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at ([0-9]*\.[0-9]*|[0-9][^A-Z][^a-z]) .*','\4')),'(watheeqa)') price
    from SMSOUTMSG@bimsic s
    where trunc(SENDDATE) = trunc(sysdate) -1
    and exists (select 1 from PHONEDETAIL@bimsic p
                where s.CUSTOMERACCOUNTID = p.CUSTOMERACCOUNTID
                and SMSFLAG = 1);Thanks.

    It does check it out
    with t
    as
    select 'dear john smith you Bought 500 shares of Nile Cotton Ginning at 14.9 L.E On 21/01/10' smstext from dual
    select
    regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\1')),'(watheeqa)') buy_sell,
    regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\2')),'(watheeqa)') amount ,
    regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at (.*)','\3')),'(watheeqa)') company ,
    regexp_replace(trim(regexp_replace(SMSTEXT,'^.* you (Sold|Bought)(.*) of (.*) at ([0-9]*\.[0-9]*|[0-9][^A-Z][^a-z]) .*','\4')),'(watheeqa)') price
    from t

  • Rplacing space with &nbsb; in html using regular expressions

    Hi
    I want to replace space with &nbsb; in HTML.
    I used  the below method to replace space in my html file.
    var spacePattern11:RegExp =/(\s)/g; 
    str= str.replace(spacePattern," "
    Here str varaible contains below html file.In this html file i want to replace space present between " What number does this  represents" with &nbsb;
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <b><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B> What number does this Roman numeral represents MDCCCXVIII ?</B></FONT></P></TEXTFORMAT></b>
    </body>
    </html>
    But by using the above regular expression i am getting like this.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head><body>
    <b><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P A LIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0 " KERNING="0"><B> What number does this represents</B></FONT></P></TEXTFORMAT></b>
    </body>
    </html>
    Here what happening means it was replacing space with &nbsb; in HTML tags also.But want to replace space with &nbsb; present in the outside of the HTML tags.I want like this using regular expressions in FLEX
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>What number does this represents</body>
    </html>
    Hi,Please give me the solution to slove the above problem using regular expressions
    Thanks in Advance to all
    Regards
    ssssssss

    sorry i missed some information in above,The modified information was in red color
    Hi
    I want to replace space with &nbsb; in HTML.
    I used  the below method to replace space in my html file.
    var spacePattern11:RegExp =/(\s)/g; 
    str= str.replace(spacePattern," "
    Here str varaible contains below html file.In this html file i want to replace space present between " What number does this  represents" with &nbsb;
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <b><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B> What number does this Roman numeral represents MDCCCXVIII ?</B></FONT></P></TEXTFORMAT></b>
    </body>
    </html>
    But by using the above regular expression i am getting like this.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head><body>
    <b><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADIN G="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B33 3C" LETTERSPACING="0" KERNING="0"><B> What number does this represents</B></FONT></P></TEXTFORMAT></b>
    </body>
    </html>
    Here what happening means it was replacing space with &nbsb; in HTML tags also.But want to replace space with &nbsb; present in the outside of the HTML tags.I want like this using regular expressions in FLEX
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>What&nbsb;number&nbsb;does&nbsb;this&nbsb;represents</body>
    </html>
    Hi,Please give me the solution to slove the above problem using regular expressions
    Thanks in Advance to all
    Regards
    ssssssss

  • Using regular expressions for validating time fields

    Similar to my problem with converting a big chunk of validation into smaller chunks of functions I am trying to use Regular Expressions to handle the validation of many, many time fields in a flexible working time sheet.
    I have a set of FormCalc scripts to calculate the various values for days, hours and the gain/loss of hours over a four week period. For these scripts to work the time format must be in HH:MM.
    Accessibility guidelines nix any use of message box pop ups so I wanted to get around this by having a hidden/visible field with warning text but can't get it to work.
    So far I have:
    var r = new RegExp(); // Create a new Regular Expression Object
    r.compile ("^[00-99]:\\] + [00-59]");
    var result = r.test(this.rawValue);
    if (result == true){
    true;
    form1.flow.page.parent.part2.part2body.errorMessage.presence = "visible";
    else (result == false){
    false;
    form1.flow.page.parent.part2.part2body.errorMessage.presence = "hidden";
    Any help would be appreciated!

    Date and time fields are tricky because you have to consider the formattedValue versus the rawValue. If I am going to use regular expressions to do validation I find it easier to make them text fields and ignore the time patterns (formattedValue). Something like this works (as far as my very brief testing goes) for 24 hour time where time format is HH:MM.
    // form1.page1.subform1.time_::exit - (JavaScript, client)
    var error = false;
    form1.page1.subform1.errorMsg.rawValue = "";
    if (!(this.isNull)) {
      var time_ = this.rawValue;
      if (time_.length != 5) {
        error = true;
      else {
        var regExp = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;
        if (!(regExp.test(time_))) {
          error = true;
    if (error == true) {
      form1.page1.subform1.errorMsg.rawValue = "The time must be in the format HH:MM where HH is 00-23 and MM is 00-59.";
      form1.page1.subform1.errorMsg.presence = "visible";
    Steve

  • 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

  • Finding URLs using regular expression.

    I have an requirement where user will type some text containing URLs like "Please visit this site http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747. Thank you". This text has to be modified as below before saving it to the database.
    "Please visit this site <a href='http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747'>http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747</a>. Thank you"
    I am using regular expression (http|https)://.+?\\s which marks the end of the url with a white space character.This pattern doesn't work if the URL is located at the end of the string since there will be no space at the end.
    For example if the string is "Please visit this site http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747" the regex will fail.
    My acutal problem is to find the URL irrespective its position within the string.
    Pattern urlPattern = Pattern.compile("(http|https)://.+?\\s", Pattern.CASE_INSENSITIVE);
    Matcher matcher = urlPattern.matcher(plainText);
    Map stringIndexMap = new HashMap();
    //Searching the input string for urlPattern...
    while(matcher.find()) {
    String urlString = matcher.group();
    //Storing the urls in a hashmap with their indices as keys....
    stringIndexMap.put(new Integer(matcher.start()), urlString.trim());
    Set keySet = stringIndexMap.keySet();
    Iterator it = keySet.iterator();
    //Iterating over the hashmap containing urls...
    while(it.hasNext()) {
    String urlString = (String) stringIndexMap.get(it.next());
    * Replacing the url string in the input text with <a href="#" onclick="window.open('<urlString>')"
    * using String index
    clickableURLString.replace(clickableURLString.indexOf(urlString),
    clickableURLString.indexOf(urlString) + urlString.length(),
    "<a href=\"#\" onclick=\"window.open('" + urlString
    + "')\">" + urlString + "</a>");
    return clickableURLString.toString();

    The end of the input is '$' as a regex.
    import java.util.regex.*;
    public class Prasanna{
      public static void main(String[] args){
        String text
    = "Please visit this site http://www.google.com/e/qHvQcWco`~!@#$%^&*()-7747";
    //    String regex = "(http|https)://.+?(?:\\s|$)"; // this works
        String regex = "(http|https)://[^ ]+";          // this also works
        Pattern pat = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
        Matcher mat = pat.matcher(text);
        while (mat.find()){
          System.out.println(mat.group());
    }

  • Searching for a substring using Regular Expression

    I have a lengthy String similar to repetetion of the one below
    String str="<option value='116813070'>Something1</option><option value='ABCDEF' selected>Something 2</option>"I need to search for the Sub string "<option value='ABCDEF' selected>" (need to get the starting index of sub string) and but the value ABCDEF can be anything numberic with varying length.
    Is there any way i can do it using regular expressions(I have no other options than regular expression)?
    thanks in advance.

    If you go through the tutorial then you will find this on the second page:
    import java.io.Console;
    import java.util.regex.Pattern;
    import java.util.regex.Matcher;
    public class RegexTestHarness {
        public static void main(String[] args){
            Console console = System.console();
            if (console == null) {
                System.err.println("No console.");
                System.exit(1);
            while (true) {
                Pattern pattern =
                Pattern.compile(console.readLine("%nEnter your regex: "));
                Matcher matcher =
                pattern.matcher(console.readLine("Enter input string to search: "));
                boolean found = false;
                while (matcher.find()) {
                    console.format("I found the text \"%s\" starting at " +
                       "index %d and ending at index %d.%n",
                        matcher.group(), matcher.start(), matcher.end());
                    found = true;
                if(!found){
                    console.format("No match found.%n");
    }It's does everything you need and a bit more. Adapt it to your needs then write a regular expression. Then if you have problems by all means come back and post them up here, but first at least attempt to solve it yourself.

  • Format string using Regular Expression

    Input string output format...
    SELECT q'<select ab_c "ABC", efg "EFG" from dual>' str FROM DUAL
    Output:
    STR                                 
    select ab_c "ABC", efg "EFG" from dual
    Required output format using regular expression...
    STR                                 
    select 'ab_c' "ABC", 'efg' "EFG" from dual

    Regular expressions have many limitations as parsing tools, and you didn't specify the rules you wanted. This expression puts quotes around the non blank string before a quoted string:
    SELECT regexp_replace(q'<select ab_c "ABC", efg "EFG" from dual>',
                          '([^" ]+)( +"[^ ]*")' , '''\1''\2' ) str FROM DUAL;
    STR
    select 'ab_c' "ABC", 'efg' "EFG" from dual
    {code}
    It is not robust - a missing " will confuse it, and you should be using bind variables anyway.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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.

  • Creating regular expression to get desired info

    Hi all!!!
    I have a little problem. I need to get the line below, but i NEED to use regular expression. I am useing java.text.regex correctly, but I dont really know how to create a regex pattern. my line is :
    [2004/01/06 12:43:58.735] [info] br.com.organox.web.aggregator.servlet.struts.action.LoginEmbeddedAction: User 'TESTER12345678' with ticket 'acLBF9a6ZiY41073400238626' logged in.
    and i need to get these two values
    'TESTER12345678' and 'logged in'
    can anyone help me?

    You could try this:
    String line = "[2004/01/06 12:43:58.735] [info] br.com.organox.web.aggregator.servlet.struts.action.LoginEmbeddedAction: User 'TESTER12345678' with ticket 'acLBF9a6ZiY41073400238626' logged in.";
    String pattern = "User '(.+?)'.+' (.+)";
    Pattern p = Pattern.compile(pattern);
    Matcher m = p.matcher(line);
    String user = null;
    String status = null;
    if (m.find())
        user = m.group(1);
        status= m.group(2);
    System.out.println("user=" + user + ", status=" + status);By the way, next time post at the "Jave programming" forum instead.

Maybe you are looking for

  • Can't get disk utility to work with leopard - iBook running super slow

    I have an iBook G4 and it's running ssuuppeerr slow but I can't get disk utility to come up after I press C down. I don't know if I'm pressing it at the wrong time but I restart with the C pressed and it gets to the apple screen and it won't go anywh

  • MSI 845PE Max2 RAM Problems

    I have some problems with putting in the 2nd RAM stick. I m running on a P4 2,4 GHz 1x 256MB DDR333 RAM pc2700 (from nanya or whatever) BIOS 1.2 AMI When i put the 2nd RAM stick in, (also 1x256 MB DDR 333 RAM pc2700 but from Twinmos) it boots up but

  • Timeout Alert

    I am running a timer on the client via javascript setTimeout. I need to use the confirm() function to get information from the user. The problem with this is that the confirm loop is stopping the event loop and my time. I was able to do an alert box

  • What is *.cpp file in the assertion log?

    Hello, I can always find some *.cpp file appear in assertion logs. What are they about? Will it affect operations? In assertion log of MDSS: 3544 2010/02/20 18:13:20.333   Assertion failed. m_socketGoneBad File name: ..\..\..\GenericLibs\ADT\SocketFi

  • Testing migration

    Hello, We are in the process of migrating from Designer 6 to 10g. I have managed to migrate selected application systems successfully from 6 into 10g. I want to be able to verify that the migration has worked. I found the following in the Oracle Desi