Regular Expression with comma and encapsulated charaters

Would appreciate some help. Looking for a regular expression to remove comma's from encapsulated text as follows
For example
- Input
1,"This is a string, need to remove the comma",Another text string,10
- Required output
1,"This is a string; need to remove the comma",Another text string,10
Have tried to use the REGEXP_REPLACE but could not grasp the pattern matching.
Thanks John

John Heaton wrote:
Thanks for the solution,this works great for a single field encapsulated by " and containing ,. I am parsing several different file definitions so it would need to cascade through the string for a undetermined number of times and replace all occurrences. Then try (performance-wise) MODEL solution:
{code}
with t as (
select '1,"This is a string, need to remove the comma",Another text string,10' txt from dual union all
select '1,"remove this comma,",Another text string,10,"remove this comma,",xxx,"remove this comma,",11' txt from dual
select txt_original,
txt
from t
model
partition by(row_number() over(order by 1) p)
dimension by(1 rn)
measures(txt txt_original,txt,0 quote)
rules
iterate(
1e9
until(
iteration_number + 1 = length(txt[1])
quote[1] = case substr(txt[1],iteration_number + 1,1)
when '"' then quote[1] + 1
else quote[1]
end,
txt[1] = case substr(txt[1],iteration_number + 1,1)
when ',' then case mod(quote[1],2)
when 1 then substr(txt[1],1,iteration_number) || ';' || substr(txt[1],iteration_number + 2)
else txt[1]
end
else txt[1]
end
TXT_ORIGINAL TXT
1,"This is a string, need to remove the comma",Another text string,10 1,"This is a string; need to remove the comma",Another text string,10
1,"remove this comma,",Another text string,10,"remove this comma,",xxx,"remove this comma,",11 1,"remove this comma;",Another text string,10,"remove this comma;",xxx,"remove this comma;",11
SQL>
SY.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Regular expressions with dates and multiple matches

    I am currently attempting to automate modifying start and end dates within a .config file via powershell but I am having issues identifying the regular expression for the end date section since both are on the same line in the file. Below is the string that
    I want to change.
    Sometimes the dates are blank and sometimes the dates are filled in.
    Dates are always in the same format (yyyy-MM-dd hh:mm).
    I also want to note that there are multiple instances of 'StartDate="" EndDate=""' for other applications throughout the same config file so I cannot limit the expression to not include the App name. 
    I do not want to limit the search to a line number since there are instances where admins will add an extra space in the config file that may throw off the line number.
    I want to replace the dates or lack there of in their respective spots on the line below via powershell:
     <App name="TestApp" StartDate="2012-03-22 13:30" EndDate="">
    I am successfully able to use 
    $startRegex = '(?<=<App name="TestApp" StartDate=")([^"]*)'
    to replace the StartDate but I can't seem to single out the EndDate with regular expression. What expression can I use to have it ignore what is in the quotations after StartDate and only pay attention to the EndDate value?
    Below is a snippet: 
    $path = d:\inetpub\website\app.config
    $startRegex = '(?<=<App name="TestApp" StartDate=")([^"]*)'
    $starttime = (get-date).ToString("yyyy-MM-dd hh:mm")
    (gc $path) -replace $startregex, $starttime | set-content $path
    I want to accomplish the same for EndDate.
    Thanks in advance!

    If you do this with XML it will be painless and less prone to error.
    $n=$xml.SelectSingleNode('//App[@name="TestApp"]')
    $n.StartDate=$newstartdate
    $n.EndDate=$newenddate
    $xml.Save($filename)
    \_(ツ)_/

  • Problem with comma and point

    Hello,
    I have a problem with comma and point in a double-digit.
    I use a english driver for HM8142. When I get the values then I only get
    int-digits. How can I change "Use comma as separator" . I tried to change
    the option in LabVIEW.
    I changed it, then I got the window. "To change, restart the programm". I
    have done this. But when I have a look at the option, it is not changed.
    What can I do?
    I am not the admin on the computer.
    Martin

    Hi Martin,
    you do not have to change any system settings neither in LabVIEW nor in your windows.
    All instrument drivers should use a point as decimal separator. You can overwrite the decimal point handling in the string functions "Scan from string" and "Format into string".
    Make a right click on the function and use "Edit Scan String". In the dialog open the ring under "Selected operation", the last entry allows you to set the character for the decimal separator. This separator will be used for all the following floating point numbers.
    From your name and problem I think you are located in central europe. I do not have a german version of LV so I cannot tell you how the elements are named in german.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Need output with commas and decimals.

    Hi All,
               I want to print this below no using write statement with commas and decimals .
                                            123,45,67,890.12
    Note :
              It must be declared in parameters and it is currency value
    and my output must also be like this
      123,45,67,890.12
    Can any one suggest me what to or send me some sample program for this,
    (points will be rewarded)
    Thanking you
    vinoth.r

    quote:
    Originally posted by:
    The ScareCrow
    You should redesign your db to have another table
    This table should have the asset id and the category id (I
    call this a bridging table)
    The category column would then be removed from the asset
    table.
    You then do a join on the tables to gain the category
    description.
    But to fix your problem with the existing structure
    Your query
    <cfquery name="qIndex" datasource="#appDSN#">
    SELECT Asset.Reference, Asset.AssetName, Asset.Category
    FROM Asset
    WHERE Category LIKE '%#URL.Category#%'
    </cfquery>
    <cfoutput query="qIndex">
    <cfset catids = ValueList(qIndex.category])>
    <cfquery name="qCat" datasource="#appDSN#">
    Select Category_Name
    From categories
    Where Category_ID IN (#catids#)
    </cfquery>
    #qIndex.Reference#<br />
    #qIndex.AssetName#<br />
    <cfloop query="qCat">
    #qCat.Category#<br>
    </cfloop>
    </cfoutput>
    Ken
    Ken, Thanks. It's really close, but all of the repeating
    records are taking the Category output from the first record in the
    set and repeating it...e.g. if the first record is "Mouse,
    Keyboards, Trackballs", all of the subsequent records show the
    same.
    Also should "ValueList(qIndex.category])", have been
    "ValueList(qIndex.category)"?
    If there's not a way to do this using the current db, i'll
    try using a bridging table.
    thanks.
    paul

  • Formatting a number element with commas and decimals.

    I have a dataset with numbers.  I already set the column type to "number".
    I want to format the number data with commas and decimals.  I found a way to add decimals, but I'm still very confused how to do commas and to combine that with the decimal formatting.
    Also, how do I apply that to a repeat region in my spry region?
    Any help would be appreciated.  Thank you very much.

    I found this on one of the forum questions.
    Excel dont preserve the trailing zeros.
    try opening the xcel and type 5.0000 and tab out, it wont preserve the trailing zeros after decimal.
    try finding out how to disable the option in excel. if you do that, you will see what you send out from the report.
    But you can try to convert the number into a text by trying to append a space at the beginning. See if that would work.
    Thanks
    Swarna

  • I have a question. I don't know what happened, but my safari went from regular safari with google and now everything is yahoo. maybe it was firefox or something. I just want the regular safari back. Can someone help me?

    Frustrated!!!!!!,
    I have a question. I don't know what happened, but my safari went from regular safari with google and now everything is yahoo. maybe it was firefox or something. I just want the regular safari back. Can someone help me?

    Check the links below for options to remove the Adware.
    The Easy, safe, effective method:
    http://www.adwaremedic.com/index.php
    If you are comfortable doing manual file removals use the somewhat more difficult method:
    http://support.apple.com/en-us/HT203987
    Also read the articles below to be more prepared for the next time there is an issue on your computer.
    https://discussions.apple.com/docs/DOC-7471
    https://discussions.apple.com/docs/DOC-8071

  • Regular expressions with boolean connectives (AND, OR, NOT) in Java?

    I'd like to use regular expression patterns that are made up of simple regex patterns connected via AND, OR, or NOT operators, in order to do some keyword-style pattern matching.
    A pattern could look like this:
    (.*Is there.*) && (.*library.*) && !((.*badword.*) || (^$))
    Is there any Java regex library that allows these operators?
    I know that in principle these operators should be available, since Regular languages are closed under union, intersection, and complement.

    AND is implicit,
    xy -- means x AND yThat's not what I need, though, since this is just
    concatenation of a regex.
    Thus, /xy/ would not match the string "a y a x",
    because y precedes x.So it has to contain both x and y, but they could be
    in any order?
    You can't do that easily or generally.
    "x.*y|y.*x" wouldll work here, but obviously
    it will get ugly factorially fast as you add more
    terms.You got that right: AND means the regex operands can appear in any order.
    That's why I'm looking for some regex library that does all this ugly work for me. Again, from a theoretical point of view, it IS possible to express the described semantics of AND with regular expressions, although they will get rather obfuscated.
    Unless somebody has done something similar in java (e.g., for C++, there's Ragel: http://www.cs.queensu.ca/~thurston/ragel/) , I will probably use some finite-state-machine libraries and compile the complex regex's into automata (which can be minimized using well-defined operations on FSMs).
    >
    You'd probably just be better off doing multiple
    calls to matches() or whatever. Yes, that's another possibility, do the boolean operators in Java itself.
    Of course, if you
    really are just looking for literals, then you can
    just use str.contains(a) && !str.contains(b) &&
    (str.contains(c) || str.contains(d)). You don't
    seem to need regex--at least not from your example.OK, bad example, I do have "real" regexp's in there :)

  • Problem in creating a Regular Expression with gnu

    Hi All,
    iam trying to create a regular expression using gnu package api..
    gnu.regex.RE;
    i need to validate the browser's(MSIE) userAgent through my regular expression
    userAgent is like :First one ==> Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
    i wrote an regular expression like this:
    Mozilla.*(.*)\\s*(.*)compatible;\\s*MSIE(.*)\\s*(.*)([0-9]\\.[0-9])(.*);\\s*(.*)Windows(.*)\\s*NT(.*)\\s*5.0(.*)
    Actaully this is validating my userAgent and returns true, my problem is, it is returning true if userAgent is having more words at the end after Windows NT 5.0 like Second One ==> Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Testing
    i want the regularExpression pattern to validate the First one and return true for it, and has to return false for the Second one..
    my code is:
    import gnu.regexp.*;
    import gnu.regexp.REException;
    public class TestRegexp
    public static boolean getUserAgentDetails(String userAgent)
         boolean isvalid = false;
         RE regexp = new RE("Mozilla.*(.*)\\s*(.*)compatible;\\s*MSIE(.*)\\s*(.*)([0-9]\\.[0-9])(.*);\\s*(.*)Windows(.*)\\s*NT(.*)\\s*5.0(.*)");
         isvalid = regexp.isMatch(userAgent);
         return isvalid;
    public static void main(String a[])
         String userAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)";
         boolean regoutput = getUserAgentDetails(userAgent);
         System.out.println("***** regoutput is ****** " + regoutput);
    }please help me in solving this..
    Thanks in Advance..
    thanx,
    krishna

    Ofcourse, i can do comparision with simple string matching..
    but problem is the userAgent that i want to support is for all the MSIE versions ranging from 5.0 onwards, so there will the version difference of IE like MSIE 6.0..! or MSIE 5.5 some thing like that..
    any ways i will try with StringTokenizer once..!
    seems that will do my work..
    Thanks,
    krishna

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

  • Regular expressions with multi character separator

    I have data like the
    where |`| is the separator for distinguishing two fields of data. I am having trouble writing a regular expression to display the data correctly.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> declare
      2  l_string varchar2 (200) :='123` 456 |`|789 10 here|`||223|`|5434|`}22|`|yes';
      3  v varchar2(40);
      4  begin
      5  v:=regexp_substr(l_string, '[^(|`|)]+', 1, 1);
      6  dbms_output.put_line(v);
      7  v:=regexp_substr(l_string, '[^(|`|)]+', 1, 2);
      8  dbms_output.put_line(v);
      9  v:=regexp_substr(l_string, '[^(|`|)]+', 1, 3);
    10  dbms_output.put_line(v);
    11  v:=regexp_substr(l_string, '[^(|`|)]+', 1, 4);
    12  dbms_output.put_line(v);
    13  v:=regexp_substr(l_string, '[^(|`|)]+', 1, 5);
    14  dbms_output.put_line(v);
    15  end;
    16  /
    123
    456
    789 10 here
    223
    5434I need it to display
    123` 456
    789 10 here
    |223
    5434|`}22
    yesI am not sure how to handle multi character separators in data using reg expressions
    Edited by: Clearance 6`- 8`` on Apr 1, 2011 3:35 PM
    Edited by: Clearance 6`- 8`` on Apr 1, 2011 3:37 PM

    Hi,
    Actually, using non-greedy matching, you can do what you want with regular expressions:
    VARIABLE     l_string     VARCHAR2 (100)
    EXEC  :l_string := '123` 456 |`|789 10 here|`||223|`|5434|`}22|`|yes'
    SELECT     LEVEL
    ,     REPLACE ( REGEXP_SUBSTR ( '|`|' || REPLACE ( :l_string
                                     , '|`|'
                                      , '|`||`|'
                                     ) || '|`|'
                        , '\|`\|.*?\|`\|'
                        , 1
                        , LEVEL
               , '|`|'
               )     AS ITEM
    FROM     dual
    CONNECT BY     LEVEL     <= 7
    ;Output:
    LEVEL ITEM
        1 123` 456
        2 789 10 here
        3 |223
        4 5434|`}22
        5 yes
        6
        7Here's how it works:
    The pattern
    ~.*?~is non-greedy ; it matches the smallest possible string that begins and ends with a '~'. So
    REGEXP_SUBSTR ('~SHALL~I~COMPARE~THEE~', '~.*?~', 1, 1) returns '~SHALL~'. However,
    REGEXP_SUBSTR ('~SHALL~I~COMPARE~THEE~', '~.*?~', 1, 2) returns '~COMPARE~'. Why not '~I~'? Because the '~' between 'SHALL' and 'I' was part of the 1st pattern, so it can't be part of the 2nd pattern. So the first thing we have to do is double the delimiters; that's what the inner REPLACE does. The we add delimiters to the beginning and end of the list. Once we've done prepared the string like that, we can use the non-greedy REGEXP_SUBSTR to bring back the delimited items, with a delimiter at either end. We don't want those delimiters, so the outer REPLACE removes them.
    I'm not sure this is any better than Sri's solution.

  • Regular Expressions with Java Regex

    Hi,
    I'm playing around with regex and there's something I can't get to work. What I need, is to capture words between 2 other words and the words captured has to be higher than 5 characters, so for example:
    Pattern "Just testing on something with regular expressions" and suppose I'll try to match all the words between "testing" and "regular", then only the word "something" should come out because "on" and "with" are not larger than 5 chars.
    Now I'm quite new to regexps and I know that ((?<=\btesting\b).*(?=\bregular\b)) will return " on something with "
    But I can't seem to come up with an expression that would only output the word "something". I've tried a few expressions like ((?<=\btesting\b)((?:[\s\w{1,3}])*(\b\w{4,}\b)*(?:[\s\w{1,3}])*)*(?=\bregular\b)) which also returns " on something with " The others I tried would either return the whole " on something with " or return "Not Found!"
    Does anyone have a tip for me? I'm well aware that it's not too hard to do something like this in Java, but I'm really looking to study regular expressions and would like to accomplish this using a regular expression.
    The Java program I use is the following:
    C:\Program Files\Java\jdk1.5.0_16\bin>java RegexTest "((?<=\btesting\b).*(?=\bregular\b))" "Just testing on something with regular expressions"
    public class RegexTest {
         public static void main(String[] args) {
              Pattern RegexCompile = Pattern.compile(args[0]);
              Matcher m = RegexCompile.matcher(args[1]);
              boolean found = m.find(); // Perhaps there's another function to find () that would do the job?
              if (found)
              System.out.println(m.group()); // Perhaps group() is not the right function for this case?
              else
              System.out.println("Not Found!");
    Edited by: dli2k3 on Sep 19, 2008 11:32 AM
    Edited by: dli2k3 on Sep 19, 2008 11:33 AM

    You're talking about a two-stage operation: find everything between those two words, then filter out anything that's less than five letters long. There's no single regex that will accomplish all that in one step.
    By the way, please use &#x7B;code} tags when you post source code.

  • Regular expressions with java.util.regex

    Hello Guys,
    I wrote last time this
    * Uses split to break up a string of input separated by
    * commas and/or whitespace.
    * See: http://developer.java.sun.com/developer/technicalArticles/releases/1.4regex/
    * Change: I have slightly modified the source
    import java.util.regex.*;
    public class Splitter {
    public static void main(String[] args) throws Exception {
    // Create a pattern to match breaks
    Pattern p = Pattern.compile("[<>\\s]+");
    // Split input with the pattern
    String[] result =
    p.split("<element attributname1 = \"attributwert1\" attributname2 = \"attributwert2\">");
    for (int i=0; i<result.length; i++)
    if (result.equals(""))
    System.out.println("EMPTY");
    else
    System.out.println(result[i]);
    int res = result.length - 1;
    System.out.println("\nStringlaenge: " + res);
    I wonder, why I got an empty element in reult[0]. Have anyone an idea?
    We'll come together next time
    ... �nhan Inay ([email protected])

    What is wrong with this Pattern?
    Pattern p = Pattern.compile("^<[a-zA-Z0-9_\\"=]+[\\s]*$>");
    This time i used following Split:
    p.split("<element attributname1=\"attributwert1\" attributname2=\"attributwert2\">");
    I've got a compilation error:
    U:\qms_neu\htdocs\inay\Source\myWork\Regex-Samples>javac Splitter.java
    Splitter.java:14: illegal start of expression
    Pattern p = Pattern.compile("^<[a-zA-Z0-9_\\"=]+[\\s]*$>");
    ^
    Splitter.java:14: illegal character: \92
    Pattern p = Pattern.compile("^<[a-zA-Z0-9_\\"=]+[\\s]*$>");
    ^
    Splitter.java:14: illegal character: \92
    Pattern p = Pattern.compile("^<[a-zA-Z0-9_\\"=]+[\\s]*$>");
    ^
    Splitter.java:14: unclosed string literal
    Pattern p = Pattern.compile("^<[a-zA-Z0-9_\\"=]+[\\s]*$>");
    ^
    Splitter.java:17: ')' expected
    p.split("<element attributname1=\"attributwert1\" attributname2
    =\"attributwert2\">");
    ^
    Splitter.java:14: unexpected type
    required: variable
    found : value
    Pattern p = Pattern.compile("^<[a-zA-Z0-9_\\"=]+[\\s]*$>");
    ^
    Splitter.java:18: cannot resolve symbol
    symbol : variable result
    location: class Splitter
    for (int i=0; i<result.length; i++)
    ^
    Splitter.java:19: cannot resolve symbol
    symbol : variable result
    location: class Splitter
    if (result.equals("")){
    ^
    Splitter.java:21: cannot resolve symbol
    symbol : variable result
    location: class Splitter
    System.out.println(result[0]);
    ^
    Splitter.java:24: cannot resolve symbol
    symbol : variable result
    location: class Splitter
    System.out.println(result[i]);
    ^
    Splitter.java:25: cannot resolve symbol
    symbol : variable result
    location: class Splitter
    int res = result.length - 1;
    ^
    11 errors

  • Regular Expressions with Call Policy on VCSe

    Hi Guys,
      I am working on firming up the call policy on my VCS Expressway to try to better intercept the SIP spam requests it is getting from internet ip numbers. Right now those spam requets are getting rejected by the loop detection but I want to intercept them before they even do a search on the Expressway. It seems that the call policy rules I create without regular expressions are functioning fine but I don't think I have the syntax correct for the regular expressions.
    The goal of this rule is to reject any incoming SIP request that has a destination alias format of 7 to 17 digits followed by an @VCSe_IP. so for example it would reject the following attempts: 0123456@VCSe_IP and 0123456789101112@VCSe_IP with one rule.
    The policy I created is this: source pattern: unauthenticated user, Destination pattern: \d{7,17}@xx\.xx\.xx\.xx (where xx is the individual octets of the VCSe IP address), Action: reject  
    However the above policy does not seem to be rejecting the calls before they do a search. I have checked the above expression with the check pattern tool on the VCSe and it comes up with a sucessful match when I try the destination alias of a request that made it through, hence my confusion. Any help you guys could provide would be appreciated.
    Thanks,
    Steven                

    Steven,
    Default Zone access rules do not relate to this at all and you can keep those set to 'No'.
    How exactly are you placing the test calls when attempting to verify this?
    I created the following CPL rule on my X7 VCS (With 10.10.10.10 being the IP address of my VCS):
    Source pattern:
    Destination pattern: \d{7,17}@10\.10\.10\.10
    Action: Reject
    I then proceeded with placing a SIP call from an unregistered C20, calling the URI '[email protected]' while running a diagnostics log on my VCS with Network log level set to 'DEBUG', and captured the following in that log:
    Incoming INVITE:
    2013-02-22T16:03:36+01:00 vcs02 tvcs: UTCTime="2013-02-22 15:03:36,598" Module="network.sip" Level="INFO":  Src-ip="10.x.x.x"  Src-port="5060"   Detail="Receive Request Method=INVITE, Request-URI=sip:[email protected], Call-ID=9dd19ad75b1063ecf716461b149e9e2a"
    2013-02-22T16:03:36+01:00 vcs02 tvcs: UTCTime="2013-02-22 15:03:36,598" Module="network.sip" Level="DEBUG":  Src-ip="10.x.x.x"  Src-port="5060"
    SIPMSG:
    |INVITE sip:[email protected] SIP/2.0
    Call processing logic, showing CPL matching:
    2013-02-22T16:03:36+01:00 vcs02 tvcs: Event="Search Attempted" Service="SIP" Src-alias-type="SIP" Src-alias="10.x.x.x" Dst-alias-type="SIP" Dst-alias="sip:[email protected]" Call-serial-number="0886391c-7d01-11e2-adf5-0050569a08fd" Tag="08863aac-7d01-11e2-bd2e-0050569a08fd" Detail="searchtype:INVITE" Level="1" UTCTime="2013-02-22 15:03:36,601"
    2013-02-22T16:03:36+01:00 vcs02 tvcs: Event="Call Attempted" Service="SIP" Src-ip="10.x.x.x" Src-port="5060" Src-alias-type="SIP" Src-alias="sip:10.x.x.x" Dst-alias-type="SIP" Dst-alias="sip:[email protected]" Call-serial-number="0886391c-7d01-11e2-adf5-0050569a08fd" Tag="08863aac-7d01-11e2-bd2e-0050569a08fd" Protocol="UDP" Auth="NO" Level="1" UTCTime="2013-02-22 15:03:36,601"
    2013-02-22T16:03:36+01:00 vcs02 tvcs: UTCTime="2013-02-22 15:03:36,602" Module="network.cpl" Level="DEBUG":  Remote-ip="10.x.x.x"  Remote-port="5060"   Detail="CPL: "
    2013-02-22T16:03:36+01:00 vcs02 tvcs: UTCTime="2013-02-22 15:03:36,602" Module="network.cpl" Level="DEBUG":  Remote-ip="10.x.x.x"  Remote-port="5060"   Detail="CPL:   "
    2013-02-22T16:03:36+01:00 vcs02 tvcs: UTCTime="2013-02-22 15:03:36,602" Module="network.cpl" Level="DEBUG":  Remote-ip="10.x.x.x"  Remote-port="5060"   Detail="CPL: matched "
    2013-02-22T16:03:36+01:00 vcs02 tvcs: UTCTime="2013-02-22 15:03:36,602" Module="network.cpl" Level="DEBUG":  Remote-ip="10.x.x.x"  Remote-port="5060"   Detail="CPL: "
    VCS responds to INVITE with 403 Forbidden:
    2013-02-22T16:03:36+01:00 vcs02 tvcs: UTCTime="2013-02-22 15:03:36,616" Module="network.sip" Level="DEBUG":  Dst-ip="10.x.x.x"  Dst-port="5060"
    SIPMSG:
    |SIP/2.0 403 Forbidden
    As you can see, on my VCS everything seems to work as expected. I'd recommend you capture a similar diagnostics log on your own VCS to check what is different in your test call compared to the output above.

  • Regular expression with delimited string

    Hi,
    I'm trying extract all characters in a string (as word or words) which is delimited by ' -- '
    Been playing around with regular expression and got as far as this;
    with t_vw
    as (select 'hello -- world' txt from dual
    union all
    select 'hello-world' from dual
    union all
    select 'hello' from dual
    union all
    select 'hello -- world -- bye' from dual
    union all
    select 'hello--worldbye' from dual
    select txt, regexp_substr(txt,'[^ -- ]+',1,1) word1,
    regexp_substr(txt,'[^ -- ]+',1,2) word2,
    regexp_substr(txt,'[^ -- ]+',1,3) word3
    from t_vw;
    It's returning;
    "TXT","WORD1","WORD2","WORD3"
    "hello -- world" "hello","world",""
    "hello-world"          "hello","world",""
    "hello"               "hello","",""
    "hello -- world -- bye"     "hello","world","bye"
    "hello--worldbye"      "hello","worldbye",""
    So it seems to work in all cases apart from when there are no spaces before/after "--".
    Any ideas?

    Please enclose your code in *{noformat}{noformat}* tags to preserve your formatting and to prevent the forum software from mangling your regular expressions.
    Also, you've given your input and show the output that you are getting, but I don't know what your issue is.  If you could include the desired output and explain how it differs from what you are getting so far that would help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Regular expression with newline in clob

    I have a clob that used end of line as chr(10).
    But if chr(10) comes in a line enclosed by quotes it needs to be skipped and be replaced by nothing.
    So the question is almost like this thread
    Regular expression
    But instead of looking for ',' I am looking for chr(10) between quotes.
    If I use the regular expression in the above forum, I donot get the same result....
    Any ideas?
    Thank you

    BTW, you can create your own function, e.g.:
    SQL> drop table t;
    Table dropped
    SQL>
    SQL> create table t (str clob);
    Table created
    SQL> insert into t values('John'||CHR(10)||'Doe'||CHR(10)||'"$85'||CHR(10)||'256"'||CHR(10)||'Programmer'||CHR(10)||'"$42'||CHR(10)||'857"');
    1 row inserted
    SQL> insert into t values('John,Doe,"$85,256",Programmer,"$42,857"');
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> select rownum, str from t;
        ROWNUM STR
             1 John
               Doe
               "$85
               256"
               Programmer
               "$42
               857"
             2 John,Doe,"$85,256",Programmer,"$42,857"
    SQL>
    SQL> create or replace function selective_replace(p_str    clob,
      2                                               p_border varchar2,
      3                                               p_sign   varchar2) return clob is
      4    l_str      clob := p_str;
      5    l_str_part clob;
      6    l_count    number := 0;
      7  begin
      8    loop
      9      l_count := l_count + 1;
    10      exit when regexp_instr(l_str, p_border||'[^'||p_border||']*'||p_border, 1, l_count)=0;
    11      l_str_part := regexp_substr(l_str,p_border||'[^'||p_border||']*'||p_border, 1, l_count);
    12      if instr(l_str_part,p_sign)>0
    13      then
    14       l_str_part := replace(l_str_part, p_sign);
    15       l_str := regexp_replace(l_str, p_border||'[^'||p_border||']*'||p_border, l_str_part, 1, l_count);
    16      end if;
    17    end loop;
    18    return(l_str);
    19  end;
    20  /
    Function created
    SQL> select str, selective_replace(str,'"',CHR(10)) new_str from t;
    STR                                                                              NEW_STR
    John                                                                             John
    Doe                                                                              Doe
    "$85                                                                             "$85256"
    256"                                                                             Programmer
    Programmer                                                                       "$42857"
    "$42                                                                            
    857"                                                                            
    John,Doe,"$85,256",Programmer,"$42,857"                                          John,Doe,"$85,256",Programmer,"$42,857"
    SQL> select str, selective_replace(str,'"',',') new_str from t;
    STR                                                                              NEW_STR
    John                                                                             John
    Doe                                                                              Doe
    "$85                                                                             "$85
    256"                                                                             256"
    Programmer                                                                       Programmer
    "$42                                                                             "$42
    857"                                                                             857"
    John,Doe,"$85,256",Programmer,"$42,857"                                          John,Doe,"$85256",Programmer,"$42857"
    SQL>

Maybe you are looking for

  • Billing Document Not getting released to accounts

    Hello experts, We are facing a problem after migration from 4.6 to ECC. When releasing a billing document to accounting we rae getting a error  "SYST: Tax jurisdiction code at lowest level not transferred". We found a note #971515 for the error which

  • Approvers are not visible in an Replacement Vacancy

    hi Im trying to create a replacement vacancy for which the approvers are not not visible. The issue is not existing for new vacancies? Can anyone please help ?

  • JDeveloper Extension for SINGLE CLICK deployment of OIM customizations

    I am not sure most of OIM Developers, System Integrators and Architects aware of this Oracle Asset, hence sharing information. In most of the questions posted on forum related to event handler usages Plugin Registration utility and weblogic scripts t

  • Motion Drop Zone template question

    I am using a drop zone template to make a short promo video. I am trying to figure out how to transition from the drop zones flying in to open the video full screen to play. So the effect I want is a bed of music and the motion template flying in 6 d

  • ICal share ...????

    am i really behind the times or has iCal Share gone? this is the third night in a row i've got the "Safari can't open the page "http://icalshare.com/" because Safari can't connect to the server "icalshare.com". message...