Regex doubt

hi,
Please fix the error in the following code
thanks in advance
Pattern pt=Pattern.compile("[\\D]");
          Matcher m=pt.matcher("2aaa");
          boolean mb=m.find();
          if(mb){
               System.out.println("matched");
          else{System.out.println("not matched");}
I am getting output as :-matched
regards,
ss

Please fix the error in the following codeIt is generally considered rude to ask other to fix your buggy code for you.
Pattern pt=Pattern.compile("[\\D]");
Matcher m=pt.matcher("2aaa");
I am getting output as :-matchedThere is no error in the code per se.
You are getting a match because there is a match (several),
the first invokation of find() searches "2aaa" and finds a match at the first "a".
Another problem; you failed to explain what you are trying to accomplish.

Similar Messages

  • Java regex doubt?

    I have a string by as follows:
    String name = "aaaaaaaaaahgcnjcdcd";I am trying to validate the above string. When the number of "a" in the string excceds 5 and above, I need to throw an error. I tried as follos:
    if (name.matches("A{5,}")){
    system.out.println("There is an error");
    }The above code works only if my name is "aaaaaaaaaaaa" (contains only more than 5 "a"s)and it is not working when name is like "aaaaaaaaaahgcnjcdcd". Can anyone give suggestion so that I will be able to thrw an error if there are more than 5 continous "a" s along with other charactes as "aaaaaaaaaahgcnjcdcd".

    cotton.m wrote:
    For the regex way you need optional wildcards on either side. And sabre or uncle_alice are likely to yell at me for suggesting indexOf so maybe just do that instead.Far from it. If all the OP is interested in is a run of 5 or more 'a' chars then indexOf() is perfect BUT if he wants 5 or more of run of any of a possible set or chars then regex fits the problem much better. Something like
    boolean isValid = "your string xxxxx possibly containing 5 or more of a sequence of x,y or z".matches(".*([xyz])\\1{4,}.*");it is possible to refine this so that there is much less backtracking but until I better understand the OP's requirement ...

  • Doubt in Regular Expressions : java.util.regex

    I want to identify words starting with capital letters in a sentence and I want to replace the matched word with "#" added in front of it.... For example, if my input sentence is
    "Christopher Williams asked Mike Muller a question"
    my output should be,
    "#Christopher #Williams asked #Mike #Muller a question"
    How do I do that using java.util.regex ?
    In perl we can can use *"back references"* in *"replacement string"* . Perl replacement accepts back references whereas java replacement method accepts only strings....
    Please help me.....

    Your replacement is swallowing the space before the uppercase character, and won't match at the beginning of the line.
    Also, it's unnecesarily verbose. String has a replaceAll method (that calls the same methods of Pattern and Matcher under the covers)sentence = s.replaceAll("(^| )([A-Z])", "$1#$2");Disclaimer: I'm no prome, sabre or u/a :-) That can probably be simplified.
    db

  • Doubt on regex

    I have to write a regular expression which should match with a string that contains caps , small letters , spaces,period and comas. the total string length should be only 50. so i have written the regex as follows but it is not giving the desired result.kindly help me.
    Regex :  [a-zA-Z,\\.\\s]{50}Edited by: Muralidhar on May 21, 2012 9:16 PM

    user13118480 wrote:
    P.S. The ^ and $ are probably not needed.Actually they probably are now, because the {0,50} means it would match an empty string now (so every possible line without them).So it would without the ^ and $ if using matches()! When used with matches() the Java regex has an implicit ^ and $. When used with find() it does not.
    >
    As changed, it now matches a blank line. So I would question whether it really should be {1,50}, but the requirements are not exactly clear.Agreed but I suspect we will never know the real requirement since I bet the OP won't be back again.

  • Using a literal "." in sed regex

    I recently picked up O'Reilly's _Classic Shell Scripting_.
    Two of the examples have me stuck.
    (1) Both the man pages on 10.4.5 and various references say that to get a literal period into the regex part of a s/regex/str/, use "\.". This command, however, ls -a | sed s/\./[hidden]/ replaces the first character of every line of input, as if the backslash is having no effect. In fact, the same one-liner without the backslash produces the same output. ???
    (2) Using ampersand ("&") in the replacement text yields the sed error "unterminated substitution in regular expression", instead of macro-ing in the matched text of the regex. I.e., the command ls -a | sed s/file/Mark's &/ causes an error. ???
    Bonus Question : Is MySQL really preloaded with OS X and, if so, where do I find it?
    Thanks. I realize that these are pretty basic questions.

    Hi cholla pete,
       Thanks for providing the exact command that you used. You would be surprised at the number of people that would simply claim that it doesn't work. However, it's easy to see what's happening with your command. The problem is that sed never sees your backslash. It is used for quoting in the shell as well as in sed. Thus, the shell "consumes" the backslash before the argument is passed to sed. The following should do what you want:
    ls -a | sed 's/^\./[hidden]/'
    Note also that I've added the beginning of the line anchor, '^', to your regular expression as I doubt that you want to replace the period that separates filenames from filename extensions.
       Regular expressions share many meta-characters with shells. It is common to use single quotes to "protect" regular expressions in arguments to utilities that consume regular expressions.
       The problem in your second sed command is the apostrophe in the name. The shell sees that as a single quote. I'm surprised that your shell executed the command when you pressed the <Return> key. However, you will probably also need to quote that sed argument as well because an ampersand preceded by a space also has meaning to most shells. Something that should do what you want is the following:
    ls -a | sed "s/tst/Mark's &/"
    Double quotes will protect both the single quote and the ampersand. However, double quotes don't protect all meta-characters from the shell. Single quotes are often necessary, even though they aren't required here.
       Unfortunately, preceding a single quote with a backslash within single quotes doesn't quote it because the single quotes quote the backslash so it doesn't do anything. Therefore, you must take single quotes out of single-quoted strings to quote them. Hence, the following will also work:
    ls -a | sed 's/tst/Mark'\''s &/'
    In this command the argument to sed is actually the concatenation of three strings, the second of which is simply a quoted single-quote.
       Tired of hearing the word "quote" yet? It can get a bit messy. However, once you learn the rules of precedence, the above becomes second nature with practice.
       Bonus Answer: No, mysql doesn't come with the client version of OS X. I don't think it comes with the server version either but I don't have one so I can't really say.
    Gary
    ~~~~
       Sin boldly.
             -- Martin Luther

  • Java regular expressions Doubt

    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class ArrayExample {
        public static void main(String[] args) {
             String message = "FAMT/4,";
             Pattern pattern = Pattern.compile("(\\w*)(/)(\\d*)(,)(\\d*)");
              Matcher matcher = pattern.matcher(message);
                 if (matcher.find()) {
                      System.out.println("matcher.group(0) : "+matcher.group(0));
                      System.out.println("matcher.group(1) : "+matcher.group(1));
                      System.out.println("matcher.group(2) : "+matcher.group(2));
                      System.out.println("matcher.group(3) : "+matcher.group(3));
                      System.out.println("matcher.group(4) : "+matcher.group(4));
                      System.out.println("matcher.group(5) : "+matcher.group(5));}
    Outbut
    matcher.group(0) : FAMT/4,
    matcher.group(1) : FAMT
    matcher.group(2) : /
    matcher.group(3) : 4
    matcher.group(4) : ,
    matcher.group(5) :
    Could Someone Explain me the output. I searched a lot on group functions and not finding anything that will clear my doubt on the output

    Group zero represents the whole match. The rest are numbered according to their positions within the regex: the first set of parentheses is group one, the second set is group two, etc.. Groups can be nested, so you actually go by the position of the opening parenthesis, '('.

  • How to use sed on a literal string containing regex meta characters?

    I want to delete the lines from a file which match an arbitrary literal string.
    The string is contained in a variable, and may itself contain various regex meta characters such as [,],^,$,|, etc
    So, my problem is that sed wants to interpret these meta characters itself. For example:
    x='abc[xyz$'
    sed -i "/$x/d" file
    produces a sed error about the unmatched [, and no doubt it wants to interpret the $ too.
    (Of course, I could try and change the string $x so that every possible regex meta character was escaped with a \, but that seems immensely cumbersome. Also, can't see a way of using single or double quotes cleverly.)
    Sorry if I am being thick about this, but any ideas or alternative methods would be most welcome!

    frostschutz wrote:
    With sed, you have to escape meta characters indivudually. That's just how it works. Of course you could do the escaping using sed as well, by replacing all meta characters (including \ and /) with \character.
    If you want to match strings literally, use a different tool. Or do it in Bash.
    while read line
    do
    [ "$line" != "$x" ] && echo "$line"
    done < file
    In Perl/PCRE instead of escaping indivudually there is \Q...\E but sed does not understand that, and \Q\E does not solve all problems either, if there is a \E in the $x you have to escape it with \E\\E\Q or something like it.
    Thank you for your swift reply. Looks like sed can't be much of a friend in these circumstances!
    Probably will have to go with the Bash file handling method.
    Oh well ...

  • Static method and variables doubts

    i have a doubt
    i have the following method
    private static void checkActionType(String action) {
    if (action.startsWith(" a")) {
    ++totalAddedActions;
    } else if (action.startsWith(" c")) {
    ++totalChangedFolders;
    } else if (action.startsWith(" p")) {
    ++totalPersonalizedActions;
    } else if (action.startsWith(" r")) {
    ++totalRemovedActions;
    } else if (action.startsWith(" v")) {
    ++totalViewedActions;
    } else if (action.startsWith(" u")) {
    ++totalUpdateActions;
    to use it, i need to declare my int variables static, because im calling this method from another static method that is called by main method.
    but this can cause me problems ?
    if i have two instances of this class running, my statics int will show the right value?
    there is a better approach?

    Here is my class, i want some advices to know if i am doing right, because everything is a little new for me.
    My class, read a log file and based upon a regular expression, it can retrieve a general statistic or a personal statistic.
    package br.com.organox.aggregator;
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.Vector;
    import org.apache.oro.text.regex.*;
    public class LogFileReader {
    private static Pattern regexpPattern;
    private static PatternMatcher patternMatcher;
    private static PatternCompiler patternCompiler;
    private static PatternMatcherInput patternInput;
    private static MatchResult matchResult;
    private static final String patternString = "^[^\']+User\\s+\'([^\']+)\'[^\']+session\\s+\'([^\']+)\'\\s+(\\S+)";
    // Integers used to store number of user, sessions and specific actions
    private static int totalUsers;
    private static int totalSessions;
    private static int totalAddedActions;
    private static int totalChangedFolders;
    private static int totalPersonalizedActions;
    private static int totalRemovedActions;
    private static int totalUpdateActions;
    private static int totalViewedActions;
    public static void main(String[] args) {
    if (args.length == 0) {
    System.out.println("No file name was specified");
    printClassUsage();
    } else if (args.length == 1) {
    printGeneralData(args[0]);
    } else if (args.length == 2) {
    System.out.println("You must set file name, data value and data type in order to " +
    "this class run properly");
    printClassUsage();
    } else {
    printSelectedData(args[0],args[1],args[2]);
    public static void printGeneralData(String fileName) {
    String data = "";
    //Users and the Session Vector are used to avoid count repeated values.
    Vector usersVector = new Vector();
    Vector sessionVector = new Vector();
    patternCompiler = new Perl5Compiler();
    patternMatcher = new Perl5Matcher();
    try {
    regexpPattern = patternCompiler.compile(patternString);
    } catch (MalformedPatternException mpe) {
    System.out.println("Error Compiling Pattern");
    System.out.println(mpe.getMessage());
    try {
    FileReader fileRead = new FileReader(fileName);
    BufferedReader buffRead = new BufferedReader(fileRead);
    while ((data = buffRead.readLine())!= null) {
    patternInput = new PatternMatcherInput(data);
    while(patternMatcher.contains(patternInput,regexpPattern)) {
    matchResult = patternMatcher.getMatch();
    // Avoid to insert repeated data in user and session Vectors
    if (usersVector.lastIndexOf(matchResult.group(1)) == -1) {
    usersVector.add(matchResult.group(1));
    if (sessionVector.lastIndexOf(matchResult.group(2)) == -1) {
    sessionVector.add(matchResult.group(2));
    increaseActionType(matchResult.group(3));
    for (int i=0;i<usersVector.size();i++) {
    totalUsers++;
    for (int i=0;i<sessionVector.size();i++) {
    totalSessions++;
    fileRead.close();
    buffRead.close();
    } catch (IOException ioe) {
    System.out.println("An I/O error occurred while getting log file data");
    ioe.printStackTrace();
    System.out.println("Users logged : " + totalUsers);
    System.out.println("Sessions opened : " + totalSessions);
    System.out.println("Added contents : " + totalAddedActions);
    System.out.println("Changed folders : " + totalChangedFolders);
    System.out.println("Personalized contents : " + totalPersonalizedActions);
    System.out.println("Removed contents : " + totalRemovedActions);
    System.out.println("Viewed Contents : " + totalViewedActions);
    System.out.println("Updated contents : " + totalUpdateActions);
    public static void printSelectedData(String fileName,String value,String valueType) {
    String data = "";
    String user = "";
    //Flag used to print the right result on screen
    String printFlag = "";
    Vector sessionVector = new Vector();
    Vector userVector = new Vector();
    Vector actionVector = new Vector();
    patternCompiler = new Perl5Compiler();
    patternMatcher = new Perl5Matcher();
    try {
    regexpPattern = patternCompiler.compile(patternString);
    } catch (MalformedPatternException mpe) {
    System.out.println("Error Compiling Pattern");
    System.out.println(mpe.getMessage());
    try {
    FileReader fileRead = new FileReader(fileName);
    BufferedReader buffRead = new BufferedReader(fileRead);
    while ((data = buffRead.readLine())!= null) {
    patternInput = new PatternMatcherInput(data);
    while(patternMatcher.contains(patternInput,regexpPattern)) {
    matchResult = patternMatcher.getMatch();
    if (valueType.equalsIgnoreCase("-user")) {
    printFlag = "userPrint";
    if ((matchResult.group(1).equalsIgnoreCase(value))) {
    userVector.add(matchResult.group(1));
    // avoid insert a repeated value inside session vector.
    if (sessionVector.lastIndexOf(matchResult.group(2)) == -1) {
    sessionVector.add(matchResult.group(2));
    increaseActionType(matchResult.group(3));
    if (userVector.size() == 0) {
    printFlag = "userPrintError";
    } else if (valueType.equalsIgnoreCase("-session")) {
    printFlag = "sessionPrint";
    if ((matchResult.group(2).equalsIgnoreCase(value))) {
    user = matchResult.group(1);
    sessionVector.add(matchResult.group(2));
    increaseActionType(matchResult.group(3));
    if (sessionVector.size() == 0) {
    printFlag = "sessionPrintError";
    } else if (valueType.equalsIgnoreCase("-action")) {
    printFlag = "actionPrint";
    if ((matchResult.group(3).equalsIgnoreCase(value))) {
    if (userVector.lastIndexOf(matchResult.group(1)) == -1) {
    userVector.add(matchResult.group(1));
    actionVector.add(matchResult.group(3));
    if (actionVector.size() == 0) {
    printFlag = "actionPrintError";
    fileRead.close();
    buffRead.close();
    } catch (IOException ioe) {
    System.out.println("An I/O error occurred while getting log file data");
    ioe.printStackTrace();
    if (printFlag.equals("userPrint")) {
    for (int i=0;i<sessionVector.size();i++) {
    totalSessions++;
    System.out.println("Sessions opened by user " + value + " : " + totalSessions);
    System.out.println("Added contents by user " + value + " : " + totalAddedActions);
    System.out.println("Changed folders by user " + value + " : " + totalChangedFolders);
    System.out.println("Personalized contents by user " + value + " : " + totalPersonalizedActions);
    System.out.println("Removed contents by user " + value + " : " + totalRemovedActions);
    System.out.println("Viewed contents by user " + value + " : " + totalViewedActions);
    System.out.println("Updated contents by user " + value + " : " + totalUpdateActions);
    } else if (printFlag.equals("userPrintError")) {
    System.out.println("This user " + value + " was not found on log file");
    } else if (printFlag.equals("sessionPrint")){
    System.out.println("Session " + value + " was opened by user " + user);
    System.out.println("Added contents by session " + value + " : " + totalAddedActions);
    System.out.println("Changed folders by session " + value + " : " + totalChangedFolders);
    System.out.println("Personalized contents by session " + value + " : " + totalPersonalizedActions);
    System.out.println("Removed contents by session " + value + " : " + totalRemovedActions);
    System.out.println("Viewed Contents by session " + value + " : " + totalViewedActions);
    System.out.println("Updated contents by session " + value + " : " + totalUpdateActions);
    } else if (printFlag.equals("sessionPrintError")){
    System.out.println("This session " + value + " was not found on log file");
    } else if (printFlag.equals("actionPrint")){
    System.out.println("Action " + value + " was performed " + actionVector.size() +
    " times for " + userVector.size() + " different user(s)");
    } else if (printFlag.equals("actionPrintError")){
    System.out.println("This action " + value + " was not found on log file");
    } else {
    System.out.println("Wrong search type!");
    System.out.println("Accepted types are: ");
    System.out.println("-user -> Search for a specified user");
    System.out.println("-session -> Search for a specified session");
    System.out.println("-action -> Search for a specified action");
    private static void increaseActionType(String action) {
    if (action.startsWith("a")) {
    ++totalAddedActions;
    } else if (action.startsWith("c")) {
    ++totalChangedFolders;
    } else if (action.startsWith("p")) {
    ++totalPersonalizedActions;
    } else if (action.startsWith("r")) {
    ++totalRemovedActions;
    } else if (action.startsWith("v")) {
    ++totalViewedActions;
    } else if (action.startsWith("u")) {
    ++totalUpdateActions;
    }

  • How to Use Regex Options in CS2 [JS] - Reg.

    Dear All,
    Hai, I have doubt about the Regex options using in CS2 - Script.
    Problem :
    filename = "FTR0123a.indd";
    k = Regex.match(filename,"(^FTR)(\d+)([A-Z*])\.(indd|indt))
    if k.match = success
    k1 = "."
    k2 = $1 [ Stored in First Value only]
    k3 = $2 [ Stored in Second Value only]
    Here I got the answers from VB.NET using Regex options. But I can't use the Same condition in Javascript.
    Please any one can give the solutions about the problem.
    Thanks & Regards
    T.R.Harihara SudhaN

    The correct format is
    filename = "FTR0123a.indd";
    k = filename.match (/^(FTR)(\d+)([A-Za-z]*)\.(indd|indt)/);
    This gives a five-element array, which you can see when you try this in the ESTK.
    Peter

  • Regex to parse stacktrace in log file

    Hi,
    How to parse the below stack trace in log file:-
    Below is the stack trace:-
    2012-08-10 08:19:17 java.lang.NullPointerException
    2012-08-10 08:19:17 at net.minecraft.server.World.tickEntities(World.java:1146)
    2012-08-10 08:19:17 at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:567)
    2012-08-10 08:19:17 at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212)
    2012-08-10 08:19:17 at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:476)
    2012-08-10 08:19:17 at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
    2012-08-10 08:19:17 at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    How to parse only the stack trace using regex? If i have put the stacktrace to a separate log file, what config needs to be done in log4j to capture only the stack trace?
    Thanks.

    > How to parse only the stack trace using regex?
    From the entire file?  I doubt it is possible.
    Log files are normally rather large.  You would need to read the entire file into memory, then apply a multiline regex which means it is going to be scanning an rescanning multiple times.  If it doesn't just die it would probably take a long time.
    Better to just build a parser that reads each line and does it.
    And of course the given example presumes that NO threads are in use.  If they are then the it is not deterministically possible to correctly the parse the file because there is no thread indicator.

  • Regex matches function

    Hi
    I am trying to come up with a regex that I can use with the matches function to validate the user id I accept. The user id can contain alphabets, numbers and 3 special chars ".","-" and "#".
    The regex I came up with was: user_id.matches("[a-zA-Z\\d\\.\\-#]"). The string I am trying to match is 'user-1'. But this fails to match.
    I am not confident about the regex I am using to match my string to. Please let me know what I am doing wrong.
    Thanks

    I would use '+' rather than '*'; I doubt that an empty string would be considered a valid user ID. ^_^   String regex = "[a-zA-Z0-9#.-]+";

  • Reguler expression - doubt

    hi, i have a doubt with "regular expression".
    My problem is, i have these words "int soma(int num,int num2 ){"
    i will need to catch a word "soma" using regular expression..
    Anyone kown to do this???
    Thanks..

    hi, i have a doubt with "regular expression".
    My problem is, i have these words "int soma(int
    num,int num2 ){"
    i will need to catch a word "soma" using regular
    expression..You don't state your requirement precisely.
    Lately your type of vague posts abound on public fora.
    Devolution?
    A stab in the dark:
    String regex = "(?<=\\s)\\p{javamethodname}+(?=\\()";

  • SBL-EAI-04316 and doubts WS

    Hi,
    I have tried to consume CRM OD's WebServices from JavaScript, but I have the following problems/doubts:
    *1) How can I obtain the entity’s (for example, Opportunity) ID from the URL?*
    I have defined the following URL to access to the report:
    https://secure-ausomxhka.crmondemand.com/OnDemand/user/ReportIFrameView?SAWDetailViewURL=saw.dll?Go%26Path%3D%252fshared%252fCompany_AHKA-JB4UI_Shared_Folder%252fIngresosProductoOportunidad&AnalyticReportName=IngresosProductoOportunidad&Action=Prompt&p0=1&p1=eq&p2=Opportunity.”Opportunity ID”&p3=%%%Id%%%
    I would like to have the value of p3 parameter, so:
    var opportunityID=$_GET("p3"); -->
    function $_GET(name){
         e = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
         var regexS = "[\\?&]"+name+"=([^&#]*)";
         var regex = new RegExp( regexS );
         var results = regex.exec( window.location.href );
         if( results == null ){
         return "";
         }else{
         return results[1];
    But it doesn’t return the value, because with window.location.href I have seen:
    https://secure-ausomxhka.crmondemand.com/OnDemand/user/ReportIFrameView?SAWDetailViewURL=saw.dll?Go%26Path%3D%252fshared%252fCompany_AHKA-JB4UI_Shared_Folder%252fIngresosProductoOportunidad&Options=rdf&Action=Prompt
    Instead of my full URL…
    *2) After login, I would like to do a QueryPage operation, but it returned SBL-EAI-04316:*
    My request message:
    var idOp = 'AHKA-180KYE';
    var soap_xml='<?xml version="1.0" encoding="UTF-8" standalone="no" ?>'
              +'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"'
              +'     xmlns:ns="urn:crmondemand/ws/ecbs/opportunity/10/2004" '
              +'     xmlns:cam="urn:/crmondemand/xml/Opportunity/Data">'
              +' <soapenv:Body>'
              +'          <ns:OpportunityQueryPage_Input>'
              +'               <cam:ListOfProductRevenue>'
              +' <cam:ProductRevenue>'
              +'           <cam:OpportunityId>'+idOp+'<\/cam:OpportunityId>'
              +' <\/cam:ProductRevenue>'
              +'               <\/cam:ListOfProductRevenue>'
              +'          <\/ns:OpportunityQueryPage_Input>'
              +'     <\/soapenv:Body>'
              +'<\/soapenv:Envelope>'
    And the response message is:
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Error al procesar el argumento urn:/crmondemand/xml/Opportunity/Data:ListOfOpportunity para la operación OpportunityQueryPage(SBL-EAI-04316)</faultstring><detail><siebelf:siebdetail xmlns:siebelf="http://www.siebel.com/ws/fault"><siebelf:logfilename>OnDemandServicesObjMgr_enu_210602.log</siebelf:logfilename><siebelf:errorstack><siebelf:error><siebelf:errorcode>(SBL-EAI-04316)</siebelf:errorcode><siebelf:errorsymbol></siebelf:errorsymbol><siebelf:errormsg>Error al procesar el argumento urn:/crmondemand/xml/Opportunity/Data:ListOfOpportunity para la operación OpportunityQueryPage(SBL-EAI-04316)</siebelf:errormsg></siebelf:error><siebelf:error><siebelf:errorcode>*(SBL-EAI-04127)*</siebelf:errorcode><siebelf:errorsymbol>IDS_EAI_ERR_INTOBJHIER_ELEM_UNKN</siebelf:errorsymbol><siebelf:errormsg>No se ha encontrado ningún elemento con código XML &apos;OpportunityId&apos; en la definición del componente de integración EAI &apos;Opportunity&apos;(SBL-EAI-04127)</siebelf:errormsg></siebelf:error></siebelf:errorstack></siebelf:siebdetail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
    What is wrong in request message¿?
    Thanks in advance and regards.

    Hi Stephan,
    thank you for your help. I have solved the problem to consume from JavaScript, but I am trying to do a simple update from JDeveloper 10g and I can't do it. The login and logoff works, but anymore operation.
    My source code is the following:
    public static void main(String[] args) {
    try {
    account_ws2realmenteesws1.proxy.DefaultClient myPort = new account_ws2realmenteesws1.proxy.DefaultClient();
    System.out.println("calling " + myPort.getEndpoint());
    // LOGIN
    String idSesionFull=Conexion_WS.logon("https://secure-ausomxhka.crmondemand.com/Services/Integration","COMPANY/USERNAME","PASSWORD");
    idSesion = Conexion_WS.getSessionId(idSesionFull);
    // UPDATE
    Account[] cuentas = new Account[1];
    cuentas[0] = new Account();
    cuentas[0].setAccountName("TEST FROM JDEVELOPER - WS");
    cuentas[0].setAccountId("AHKA-23T7PS");
    myPort.accountUpdate(cuentas, "Off");
    // LOGOFF
    System.out.println("desconexión...");
    Conexion_WS.logoff("https://secure-ausomxhka.crmondemand.com/Services/Integration", idSesion);
    } catch (Exception ex) {
    // LOGOFF
    System.out.println("desconexión...");
    Conexion_WS.logoff("https://secure-ausomxhka.crmondemand.com/Services/Integration", idSesion);
    ex.printStackTrace();
    Thank you in advance and regards.

  • Patterns/regex: determine an intersection of patterns/regex

    Hi.
    Does anyone know how to determine the pattern/regex that reflects the intersection of 2 or more patterns?
    F.ex.:
    intersection of [0-9]+[a-z]+ with [1-2]*[a-c]* would be [1-2]+[a-c]+ right?
    Any ideea?
    Many thanks.

    Wow! That was quick.
    I also think that it's not so easy to do. But the hope never dies ... I thought someone already got this problem and knows the solution...
    Anyway, thanks for your response.
    P.S. the example was just an example to explain what i mean. I had no doubts that's right.

  • Get Variant Attribute Should Search for and return multiple values based on RegEx

    I am using Variants as lookup tables (see this article):
    Using Variant Attributes to Build a Dictionary or Look-up Table
    I would like to be able to use some sort of wildcard to return multiple results from the Get Variant Attribute VI (all results are of the same type, and I don't know the exact names of all the results - those two points make this idea distinct from this idea: Set/Get Variant Attribute for Multiple Attributes).
    Ideally the wildcard would be RegEx.  If it were, the means by which you specify what to return is standardized.
    In the above example, there would be some ambiguity in terms of whether or not you would want to return a result or an array of results given an input, and I doubt you could detect and assume RegEx is what the programmer desires to use.  So I think this means a new input would be required to specify whether or not the "name" input of the Get Variant Attribute VI should be interpreted as a RegEx query.
     

    Why RegEx? Why not SQL query? Why not filename wildcard matching?
    I don't see anything that makes RegEx special. For this kind of functionality, the code that you've written seems like exactly the right way to do it rather than bolting a RegEx parser or any other system into the primitives or clouding the palette with a bunch of primitives to support various search functions. I could see a primitive that takes a VI refnum that has a conpane of string in/boolean out that you would pass in to supply the filter functionality that you want for any given application, but even that I'd lean toward just letting that be a library that someone writes on top of the primitives. Yes, there is some memory reduction that can be done if it is internal to the primitives, no question about that. But there are so many variations in how to do that filtration/sorting/etc that I'm not confident that any prim would cover a sufficient use case to be worth it. I could be wrong here ... let's see what other comments come in.

Maybe you are looking for