Evaluating an expression in a string

I need to evaluate an expression in a string, and return 0 or 1 for true or false.
Here is a version I tried:
06:25:26  > CREATE OR REPLACE FUNCTION MJT_EVALUATE_EXPR (in_expr_to_evaluate VARCHAR2)
06:26:00   2     RETURN NUMBER
06:26:00   3  IS
06:26:00   4     l_dual_record   DUAL%ROWTYPE;
06:26:00   5     csr_dual        SYS_REFCURSOR;
06:26:00   6     l_this_result   NUMBER;
06:26:00   7  BEGIN
06:26:00   8     OPEN csr_dual FOR 'SELECT * FROM DUAL WHERE ' || in_expr_to_evaluate;
06:26:00   9 
06:26:00  10     FETCH csr_dual INTO l_dual_record;
06:26:00  11 
06:26:00  12     IF csr_dual%FOUND
06:26:00  13     THEN
06:26:00  14        l_this_result := 1;
06:26:00  15     ELSE
06:26:00  16        l_this_result := 0;
06:26:00  17     END IF;
06:26:00  18 
06:26:00  19     CLOSE csr_dual;
06:26:00  20 
06:26:00  21     RETURN l_this_result;
06:26:00  22  END;
06:26:00  23  /
Function created.
06:26:11> select mjt_evaluate_expr('((1=1) OR (1=0))') from dual;
MJT_EVALUATE_EXPR('((1=1)OR(1=0))')
                                  1
1 row selected.
Elapsed: 00:00:00.02
06:26:22 > Due to the high number of executions, I would like to avoid dynamic SQL or cursor operations such as this. Does anyone have a suggestion for another approach?
The expressions can get more complex than this, possibly with dozens of terms.

Does anyone have a suggestion for another approach?I don't think you'll gain any performance but for the records:
SQL> select * from v$version where rownum = 1
BANNER                                                                         
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production         
1 row selected.
SQL> var bool varchar2(40)
SQL> exec :bool := '1=1 and 1=0'
PL/SQL procedure successfully completed.
SQL> select decode(column_value, 'true', 1, 0) bool from xmltable (:bool)
      BOOL
         0
1 row selected.

Similar Messages

  • Evaluating boolean expressions from a string

    Hi All,
    In my program I am dynamically generating boolean expressions.
    Hence, I store the expression as a string. I want to be able to determine if that expression evaluates to true/false.
    For eg, String expr = "1 < 2";
    I want to be able to evaluate expr and print false(in this case)
    How can I do that? Are there any class that come with JDK1.4 for doing this or can you point me to some API that I can use for this.
    Thanks,
    Vijay

    I can't count how many times this has been askedhere.
    Try searching the forums.Give yourself credit - you could count it if you
    wanted to.
    OK, maybe so. But I can't count it off the top of my
    head. :-) But easier than counting the hairs on your head (well.....presuming you do have some....)
    Really, it's bizarre how much this gets
    asked. I think I'll start a new thread about it...Be realistic....the integer to string or string to integer gets asked a lot more often!

  • Computing an expression in a string?

    I have an expression in a string, how can I compute this? I know I can put it in post fix and travers it with a Stack, but there must be an easier way in Java, e.g. How can I evaluation this string into an integer of 10?
    String s = "5+5";
    // how can I compute the expression in s???
    int i=???

    I appreciate the response, but have to agree with jschell
    With Java being an interpreted language, you would think it could resolve expressions built on the fly and residing in a string. I also see IDEs like IntelliJ that have an evaluate option in the debugger, so that is why I thought there might be a way. Perhaps they coded their own. I also saw a reference to an Expression Object, but could not make sense of it.
    If this issue of evaluatiing expressions in strings is a question has ben asked man times before, hopefully someone from Sun who works on the JDK is reading this, and considering adding this feature. I have seen this capability in another programming language, and have even seen the dynamic creation of programming statements built in strings.

  • How can I convert the variable expression stored as string back to variable expression

    How can I convert the variable expression stored as string back to variable expression?
    I am storing the expression enterd in the TSExpresssionEditControl as simple string and want to convert back to expression since I want to get the data type of that expression.

    pritam,
    I'm not sure what you're trying to do exactly. If you are trying to get the value of a variable and you only have the name of value in a string, then you can use Evaluate() to get its value. If you want the data type, my advise is to use the GetPropertyObject() API method and just pass in the loop up string. Then you'll have a handle to the data object and then proceed from there.
    Regards,
    Song D
    Application Engineer
    National Instrument
    Regards,
    Song Du
    Systems Software
    National Instruments R&D

  • ORAMED-01101 :[Filter Expression Error]Error evaluating filter expression.

    I am a newbie with oracle soa suite 11g. I am trying to use file adapter to upload the csv file contents to database.
    My csv file looks like:
    employeeid,employeename,designation,managerempid
    1121,abc,mts,211
    1122,def,mts,232
    1123,xyz,abc,133
    The generated xml file during the xsd test is
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <Root-Element xmlns="http://TargetNamespace.com/EmpAdaptor">
    <emp>
    <employeeid>1121</employeeid>
    <employeename>suneetha</employeename>
    <designation>mts</designation>
    <managerempid>211</managerempid>
    </emp>
    <emp>
    <employeeid>1122</employeeid>
    <employeename>challa</employeename>
    <designation>mts</designation>
    <managerempid>232</managerempid>
    </emp>
    <emp>
    <employeeid>1123</employeeid>
    <employeename>xyz</employeename>
    <designation>abc</designation>
    <managerempid>133</managerempid>
    </emp>
    </Root-Element>
    and in the mediator, I have the filter expression as shown:
    $in.body/ns1:EmpDetails/ns1:Emp
    the d/b table i created is
    CREATE TABLE empdtls (EMPID NUMBER(5) PRIMARY KEY,ENAME VARCHAR2(15) NOT NULL,DESIG VARCHAR2(10),MGREMPID NUMBER(5));
    When I deployed it, the application throws the below fault
    Non Recoverable System Fault :
    ORAMED-01101:[Filter Expression Error]Error evaluating filter expression.Possible Fix:Please make sure filter expression is valid, otherwise contact oracle for support. Cause:ORAMED-01102:[Filter Expression Metadata Error]Error evaluating filter expression, "$in.body/ns1:EmpDetails/ns1:Emp"Possible Fix:Please make sure filter expression metadata is valid, otherwise contact oracle for support.
    I have been trying to fix this error for almost three days..
    Somebody please help me..

    Sorry the generated xml during test is
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <EmpDetails xmlns="http://TargetNamespace.com/ServiceName">
    <Emp>
    <employeeid>1121</employeeid>
    <employeename>suneetha</employeename>
    <designation>mts</designation>
    <managerempid>211</managerempid>
    </Emp>
    <Emp>
    <employeeid>1122</employeeid>
    <employeename>challa</employeename>
    <designation>mts</designation>
    <managerempid>232</managerempid>
    </Emp>
    <Emp>
    <employeeid>1123</employeeid>
    <employeename>xyz</employeename>
    <designation>abc</designation>
    <managerempid>133</managerempid>
    </Emp>
    </EmpDetails>

  • OSB insert in not evaluating the expression

    I am using insert in the proxy service of OSB and and my expression is like this:
    Expression : <fcs:appId>$body/*/appId/node()</fcs:appId>
    My problem is that it's not evaluating the expression. It's inserting this as text ($body/*/appId/node()).
    Any idea, why?

    I assume you want to get the value of the tag appid, then the correct expression is <fcs:appId>{$body/*/appId/text()}</fcs:appId>
    In case there is namespace defined with your xml tag then you should be using it as <fcs:appId>{$body/*/*:appId/text()}</fcs:appId>
    Thanks,
    Patrick
    Edited by: Patrick Taylor on May 25, 2011 8:15 PM

  • Binding assignment is not available:Error in the evaluation of expression

    Hi All,
    I have created Workflow to send an Email using Requested Start date concept of a Task.This is for sending a E-mail to the customer when contract end date-60 Days.
    I have done all Bindings and I am getting The date and time from BOR which I am using to triger an Event.
    I am getting these type of Errors:
    Source (expression '&BUS2000137.TIME&') of binding assignment is not available
    Source (expression '&BUS2000137.DATE&') of binding assignment is not available
    Error in the evaluation of expression '<???>&BUS2000137.DATE&' for item '1'
    Unable to determine the value of component ''
    Error in the evaluation of expression '<???>&BUS2000137.TIME&' for item '1'
    Unable to determine the value of component ''
    Looking for Inputs.
    Regard's,
    Lokesh

    Hi Adrash/Rick,
    Object type  ZBS2000137
    Attributes
    ZBS2000137.Time    Time to send mail --> Is nothing but OBJECT-TIME = SY-UZEIT
    ZBS2000137.Date    60 days before contract end date  --> Is nothing but  OBJECT-DATE =  LS_APPOINTMENT-DATE_FROM - 60.
    Methods
    ZBS2000137.Method1       Sending Mail
    Events
    ZBS2000137.Released      Contract Line Item Released
    ie I want to excute the task with same DATE and TIME, the same I have mentioned in "
    Requested Strat Tab with Expression as below
    Refer.date/time EXP Expression
    Date &BUS2000137.DATE&     60 days before contract end date
    Time &BUS2000137.TIME&      Time to send mail
    Note: If I am testing the Workflow from T-code: SWUS it is working fine.
    Regard's,
    Lokesh.

  • Regular expression - splitting a string

    I have a long string that I'm trying to split into a series of substrings. I would like each of the substrings to start with "TTL.. I'm fairly certain that I'm missing something very basic here. I've attached my code which yield NO GROUPS. I didn't see another method for returning the text that the regular expression matched.
    String finalLongstring="TTL1,clip1+TTL2+clip3,TTL4,clip4,TTL5,clip5+TTL6+"+
       "clip6+TTL7+clip7,TTL8,clip8,TTL9,clip9,TTL10,clip10,TTL11,clip11,TTL12,clip12,"+
       "TTL13,clip13+TTL14+clip14,TTL15,clip15,TTL16,clip16,TTL17,clip17,"+
       "TTL18,clip18,TTL19,clip19,TTL20,clip20,TTL21,clip21,TTL22,clip22,"+
       "TTL23,clip23,TTL24,clip24,TTL25,clip25,TTL26,clip26,TTL27,clip27,"+
       "TTL28,clip28,TTL29,clip29"
    List<String> chapters = new ArrayList<String>();
              chapters.clear();
              Pattern chapter=null;
              chapter=Pattern.compile("(TTL\\d+([+,]|clip\\d+)*)");
              //                      ||    |  |  | |  |    | |
              //                      ||    |  |  | |  |    | Repeat (commas pluses and clips group) 0 or more times
              //                      ||    |  |  | |  |    one or more digits following 'clip'
              //                      ||    |  |  | |  clip
              //                      ||    |  |  | or..
              //                      ||    |  |  plus or comma symbols
              //                      ||    |  group the +, and clip information together
              //                      ||    one or more digits
              //                      |Match clips starting with TTL
              //                      |
              Matcher cp = chapter.matcher(finalLongstring);  //NO MATCHES!!
              String [] temp = chapter.split(finalLongstring);  //temp =EMPTY STRING ARRAY
              do{
                   String chapterPlus=cp.group(1);
                   if(cp.hitEnd()){break;}
                   chapters.add(chapterPlus);
              }while(true);Thanks in advance for the help.
    Icesurfer

    The main reason your matcher didn't work is because you never told it to do anything. You have to call one of the methods matches(), find() or lookingAt(), and make sure it returns true, before you can use the group() methods. When I did that, your regex worked, but then I modified it to demonstrate a better use of capturing groups, as shown here: import java.util.regex.*;
    public class Test
      public static void main(String... args)
        String str="TTL1,clip1+TTL2+clip3,TTL4,clip4,TTL5,clip5+TTL6+clip6+"+
           "TTL7+clip7,TTL8,clip8,TTL9,clip9,TTL10,clip10,TTL11,clip11,TTL12,clip12,"+
           "TTL13,clip13+TTL14+clip14,TTL15,clip15,TTL16,clip16,TTL17,clip17,"+
           "TTL18,clip18,TTL19,clip19,TTL20,clip20,TTL21,clip21,TTL22,clip22,"+
           "TTL23,clip23,TTL24,clip24,TTL25,clip25,TTL26,clip26,TTL27,clip27,"+
           "TTL28,clip28,TTL29,clip29";
        Pattern p = Pattern.compile("(TTL\\d+)[+,](clip\\d+)[+,]");
        Matcher m = p.matcher(str);
        while (m.find())
          System.out.printf("%6s %s%n", m.group(1), m.group(2));
    }The reason your split() attempt didn't work is because the regex matched all of the text; the split() regex is supposed to match the parts you don't want. In fact, it did split the text, creating a list of empty strings, but then it threw them all away, because split() discards trailing empty fields by default.
    Finally, the hitEnd() method is not appropriate in this context. It and the requireEnd() method were added to support the Scanner class in JDK 1.5. If you want to see how they work, look at the source code for Scanner, but for now, just classify them as an advanced topic. When you're iterating through text with the find() method, you stop when find() returns false, plain and simple.

  • Remove regular expression from a string

    Hello,
    I have a string like this
    @1test;'"{input+
    Please help me to remove special characters from the string.

A: remove regular expression from a string

Hi Krishna,
DATA : str TYPE STRING VALUE '@1test;"{}]input+',
            char,
            length TYPE i,
            index TYPE i.
length = STRLEN( str ).
WHILE length > index.
  char = str+index(1).
  WRITE char.
  if char CA '+-*/!`@#$%^&()_=[]{};'.               " Add/Remove here to include numbers
    REPLACE ALL OCCURRENCES OF char in str WITH ''.
    REPLACE ALL OCCURRENCES OF '"' in str WITH ''.  " characters "{}[] are not comparable
    REPLACE ALL OCCURRENCES OF '{' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '}' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '[' in str WITH ''.
    REPLACE ALL OCCURRENCES OF ']' in str WITH ''.
    length = STRLEN( str ).
    ENDIF.
  add 1 to index.
ENDWHILE.
WRITE str.
Add or remove special char from '+-*/!`@#$%^&()_=[]{};' in if part as per your requirement.
Hope it meets your requirement.
Do not forget to mark helpful/correct if ma answer is useful .
Thanks,
Karthik

Hi Krishna,
DATA : str TYPE STRING VALUE '@1test;"{}]input+',
            char,
            length TYPE i,
            index TYPE i.
length = STRLEN( str ).
WHILE length > index.
  char = str+index(1).
  WRITE char.
  if char CA '+-*/!`@#$%^&()_=[]{};'.               " Add/Remove here to include numbers
    REPLACE ALL OCCURRENCES OF char in str WITH ''.
    REPLACE ALL OCCURRENCES OF '"' in str WITH ''.  " characters "{}[] are not comparable
    REPLACE ALL OCCURRENCES OF '{' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '}' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '[' in str WITH ''.
    REPLACE ALL OCCURRENCES OF ']' in str WITH ''.
    length = STRLEN( str ).
    ENDIF.
  add 1 to index.
ENDWHILE.
WRITE str.
Add or remove special char from '+-*/!`@#$%^&()_=[]{};' in if part as per your requirement.
Hope it meets your requirement.
Do not forget to mark helpful/correct if ma answer is useful .
Thanks,
Karthik

  • Evaluating xpath expressions

    Hi all,
    I have an xml document as
    <?xml version="1.0" encoding="UTF-8"?>
    <purchaseReport xmlns="http://www.example.com/Report" >
    <regions>
    <zip code="95819">
    <part number="872-AA" quantity="1"/>
    <part number="926-AA" quantity="1"/>
    <part number="833-AA" quantity="1"/>
    <part number="455-BX" quantity="1"/>
    </zip>
    <zip code="63143">
    <part number="455-BX" quantity="4"/>
    </zip>
    </regions>
    <parts>
    <part number="872-AA">Lawnmower</part>
    </parts>
    </purchaseReport>
    when I evaluate the for an expression xpath_object.evaluate(f,"/purchaseReport/parts/part/@number",NODE)
    I am getting null as return value.
    I have set the namespace context for xpath_object as
    xpath_object.setNameSpaceContext(new name_space_context());
    class name_space_context implements NamespaceContext{
    public String getNamespaceURI(String prefix){
    //System.out.println("A call was made here");
    if(prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)){
    System.out.println("A call was made here");
    return "http://www.example.com/Report";
    else if(prefix.equals(XMLConstants.XML_NS_PREFIX)) {
    System.out.println("A call was made here");
    return XMLConstants.XML_NS_URI;
    else if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)){
    System.out.println("A call was made here");
    return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
    else if(prefix.equals("def")){
    System.out.println("A call was made here def");
    return "http://www.example.com/Report";
    else if(prefix.equals("si")){
    System.out.println("A call was made here si");
    return "http://www.example.com/Report/si";
    else if(prefix.equals("")){
    System.out.println("A call was made here empty");
    return "http://www.example.com/Report";
    else {
    return "There is no matching prefix with the given input" + prefix;
    please explain why me I am getting null when I evalute the expression.

    Hi tsuji,
    I am trying to update the element value in my xml , by getting input the xml and the xpath.
    My code is as below.
    InputSource is;
    is = new InputSource(new StringReader(input.toString()));
    Node node = (Node)xPath.evaluate(XPATH, is, XPathConstants.NODE);
    node.setTextContent(newValue);
    I succeeded in evaluating the namespace prefix also.
    After updating the value of the node, I tried to display the updated xml. But i couldnt succeed.
    i tried,
    Making 'Document' out of the 'is' - but failed throws NullPointerException in Document doc=dBuilder.parser(is)
    Please help me in displaying the updated XMLdocument.
    I have a doubt here, in this case like mere changing the value of the node, will it change the original InputSource 'is'
    But , when i used
    NodeIterator nl = XPathAPI.selectNodeIterator(doc, xpath); //here doc is the Document object, xpath is String object
    n=nl.nextNode();
    n.setTextContent(newValue);
    Then when i tried displaying the doc again, it gave me the updated document.
    I couldnt proceed with NodeIterator , i couldnt apply the setNamespaceContext.
    Kindly help me in this regard.
    Thanks,
    Sabarisri. N

  • Please help ... evaluating jsp:expression in attributes

    Dear All,
    I have searched the forum and found a few posts expressing a similar problem. However none seemed to divulge any solution.
    <option value="<jsp:expression> signals[count] </jsp:expression>"><jsp:expression> signals[count] </jsp:expression></option>In the code above the second expression evaluates fine but the first causes problems. Its the angle brackets of the jsp:expression:
    The value of attribute "value" must not contain the '<' characterI have also tried <%= %> and %= % as has been suggested in previous posts
    <%= => fails also because of the angle brackets
    %= % is set to the value, instead of the evaluated expression.
    Am Completely Stumped. Surely there must be a way to do this!?!
    Thanks is advance

    Hi Steve, thanks for your help I have resolved the problem. Somewhere in the J2EE Tutorial I found a snippet of code that talked about using CDATA tags.
    My working code now looks like this:
    <td><select name="signal_list" multiple="multiple">
        <jsp:useBean id="signalslist" class="acreweb.SignalsList" scope="session" />
            <jsp:scriptlet>
                int count = 0;
                System.out.println("useBean");
                String[] signals = signalslist.getSignals();
                while(count < signals.length)
         //Display signal names in select box
         System.out.println(signals[count]);
         </jsp:scriptlet>
              <![CDATA[<option value=']]><jsp:expression>new String(signals[count])</jsp:expression><![CDATA[' />]]><jsp:expression> signals[count] </jsp:expression>
         <jsp:scriptlet>     
         count++;
               </jsp:scriptlet>
        </select>
    </td>Sorry about formatting am being dragged to the pub, impatient work colleagues

  • Expression Builder: convert string to number

    Hi all,
    I'm having trouble building a field validation rule for bank account numbers.
    The numbers have 12 positions, so I cannot use a string or text number.
    The validation rule to be implemented is that the last two digits are calculated based on the first 10 (modulo 97).
    However, when I use the Mid function to pick the first characters, I am unable to do any calculations on it. Apparently, the string to number conversion doesn't work (it should work when I read the manual, as it says that when using an operator between two data types, the second type is converted to the first (cf. example of 1234+abcd (should result in 1234 as to the manual))). So I tried '1*Mid(...)' or '0+Mid(...)'. Syntactically the expression builder accepts it and I can save it. BUT when I change the particular value on the screen, it gives me an SSO error (not the Field Validation error message I entered).
    Why isn't there simply a function ToNumber (like ToChar)????? How could I workaround this?
    Any input very welcome!
    Frederik

    Apparently, I was a bit confused when typing the first sentence, it should be:
    The numbers have 12 positions, so I cannot use an integer or number data type, but have to use String.

  • Regular Expressions with Unicode Strings - length restriction?

    Hi,
    I can't quite figure this one out. I am checking a String for the presence of a URL.. more specifically, a jpg or gif URL.
    Anyway, the following reg exp will work fine for me. However, when testing with unicode data (chinese text) the expression will only work up to a certain string length. Here's an example:
    boolean isURL = text.matches(".*http\\S*(jpg|gif).*");
    My thought is that since Unicode data takes up more space, there a limitation to dealing with Strings. Does anyone know what that number is? Or, is there another reason the reg exp fails??
    thanks,
    joe
    Example::
    This works for any length String I throw at it using standard ASCII text.. But a unicode string of a certain length won't recognize the URL (I doubt I can simply paste my example here and have it turn out correctly..)
    DOESN'T WORK: (length is reported via text.length() as 344
    "FWD: test_tancy: FWD: tancy: FWD: supporter:
    &#27973;&#28129;&#33394;&#24425;&#36896;&#28165;&#20937;
    &#35201;&#35753;&#23621;&#25152;&#30475;&#36215;&#26469;&#28165;&#29245;&#20937;&#24555;&#65292;&#21487;&#37319;&#29992;&#20197;&#30333;&#33394;&#20026;&#20027;&#35843;&#30340;&#24067;&#32622;&#12290;&#30333;&#33394;&#19981;&#20294;&#33021;&#22686;&#21152;&#31354;&#38388;&#24863;&#65292;&#36824;&#33021;&#33829;&#36896;&#26126;&#24555;&#23425;&#38745;&#30340;&#27668;&#27675;&#65292;&#35753;&#20154;&#24773;&#32490;&#31283;&#23450;&#12290;&#21478;&#22806;&#65292;&#26377;&#24847;&#35782;&#22320;&#22686;&#28155;&#19968;&#28857;&#20919;&#33394;&#65292;&#20063;&#33021;&#20196;&#20154;&#22312;&#35270;&#35273;&#19978;&#35273;&#24471;&#30021;&#24555;&#12290;&#19981;&#36807;&#65292;&#19968;&#38388;&#25151;&#20869;&#33509;&#20840;&#37096;&#20351;&#29992;&#20919;&#33394;&#65292;&#25110;&#20840;&#37096;&#37319;&#29992;&#26262;&#33394;&#65292;&#20250;&#20351;&#20154;&#24863;&#21040;&#19981;&#23433;&#12290;&#26368;&#22909;&#26159;&#30830;&#23450;&#20027;&#33394;&#21518;&#65292;&#23567;&#38754;&#31215;&#20351;&#29992;&#20123;&#21576;&#40092;&#26126;&#23545;&#27604;&#30340;&#33394;&#24425;&#12290;&#20837;&#22799;&#36141;&#32622;&#19968;&#20123;&#33394;&#35843;&#28165;&#20937;&#30340;&#39280;&#29289;&#25670;&#35774;&#65292;&#26159;&#26368;&#30465;&#38065;&#26377;&#25928;&#30340;&#19968;&#25307;&#65292;&#22914;&#20026;&#21488;&#28783;&#25442;&#20010;&#30333;&#33394;&#28783;&#32617;&#12289;&#22312;&#27927;&#25163;&#38388;&#25918;&#19968;&#22871;&#20912;&#34013;&#33394;&#30340;&#27792;&#28020;&#29992;&#20855;&#31561;&#12290;(UU&#20026;&#24744;&#25552;&#20379;&#29983;&#27963;&#21672;&#35759;&#24182;&#31069;&#24744;&#29983;&#27963;&#24841;&#24555;&#65281;&#22914;&#19981;&#24076;&#26395;&#25171;&#25200;&#35831;&#22238;&#22797;?NO?)http://www.blah.com/servlet/mailbox?item=fc-10Tq9aljw0w9.jpg"
    WORKS: (length is reported via text.length() as 296
    "FWD: Joe: &#35201;&#35753;&#23621;&#25152;&#30475;&#36215;&#26469;&#28165;&#29245;&#20937;&#24555;&#65292;&#21487;&#37319;&#29992;&#20197;&#30333;&#33394;&#20026;&#20027;&#35843;&#30340;&#24067;&#32622;&#12290;&#30333;&#33394;&#19981;&#20294;&#33021;&#22686;&#21152;&#31354;&#38388;&#24863;&#65292;&#36824;&#33021;&#33829;&#36896;&#26126;&#24555;&#23425;&#38745;&#30340;&#27668;&#27675;&#65292;&#35753;&#20154;&#24773;&#32490;&#31283;&#23450;&#12290;&#21478;&#22806;&#65292;&#26377;&#24847;&#35782;&#22320;&#22686;&#28155;&#19968;&#28857;&#20919;&#33394;&#65292;&#20063;&#33021;&#20196;&#20154;&#22312;&#35270;&#35273;&#19978;&#35273;&#24471;&#30021;&#24555;&#12290;&#19981;&#36807;&#65292;&#19968;&#38388;&#25151;&#20869;&#33509;&#20840;&#37096;&#20351;&#29992;&#20919;&#33394;&#65292;&#25110;&#20840;&#37096;&#37319;&#29992;&#26262;&#33394;&#65292;&#20250;&#20351;&#20154;&#24863;&#21040;&#19981;&#23433;&#12290;&#26368;&#22909;&#26159;&#30830;&#23450;&#20027;&#33394;&#21518;&#65292;&#23567;&#38754;&#31215;&#20351;&#29992;&#20123;&#21576;&#40092;&#26126;&#23545;&#27604;&#30340;&#33394;&#24425;&#12290;&#20837;&#22799;&#36141;&#32622;&#19968;&#20123;&#33394;&#35843;&#28165;&#20937;&#30340;&#39280;&#29289;&#25670;&#35774;&#65292;&#26159;&#26368;&#30465;&#38065;&#26377;&#25928;&#30340;&#19968;&#25307;&#65292;&#22914;&#20026;&#21488;&#28783;&#25442;&#20010;&#30333;&#33394;&#28783;&#32617;&#12289;&#22312;&#27927;&#25163;&#38388;&#25918;&#19968;&#22871;&#20912;&#34013;&#33394;&#30340;&#27792;&#28020;&#29992;&#20855;&#31561;&#12290;(UU&#20026;&#24744;&#25552;&#20379;&#29983;&#27963;&#21672;&#35759;&#24182;&#31069;&#24744;&#29983;&#27963;&#24841;&#24555;&#65281;&#22914;&#19981;&#24076;&#26395;&#25171;&#25200;&#35831;&#22238;&#22797;?NO?)http://www.blah.com/servlet/mailbox?item=fc-10Tq9aljw0w9.jpg"

    Perhaps you should check the version of Java you are using. I am using 1.4.2_04
    public class A {
        public static void main(String[] args) throws UnsupportedEncodingException {
            String text = "FWD: test_tancy: FWD: tancy: FWD: supporter:                   " +
                    new String(new char[]{(char) 35201, (char) 35753, (char) 23621, (char) 25152, (char) 30475, (char) 36215,
                                          (char) 26469, (char) 28165, (char) 29245, (char) 20937, (char) 24555, (char) 65292,
                                          (char) 21487, (char) 37319, (char) 29992, (char) 20197, (char) 30333, (char) 33394,
                                          (char) 20026, (char) 20027, (char) 35843, (char) 30340, (char) 24067, (char) 32622,
                                          (char) 12290, (char) 30333, (char) 33394, (char) 19981, (char) 20294, (char) 33021,
                                          (char) 22686, (char) 21152, (char) 31354, (char) 38388, (char) 24863, (char) 65292,
                                          (char) 36824, (char) 33021, (char) 33829, (char) 36896, (char) 26126, (char) 24555,
                                          (char) 23425, (char) 38745, (char) 30340, (char) 27668, (char) 27675, (char) 65292,
                                          (char) 35753, (char) 20154, (char) 24773, (char) 32490, (char) 31283, (char) 23450,
                                          (char) 12290, (char) 21478, (char) 22806, (char) 65292, (char) 26377, (char) 24847,
                                          (char) 35782, (char) 22320, (char) 22686, (char) 28155, (char) 19968, (char) 28857,
                                          (char) 20919, (char) 33394, (char) 65292, (char) 20063, (char) 33021, (char) 20196,
                                          (char) 20154, (char) 22312, (char) 35270, (char) 35273, (char) 19978, (char) 35273,
                                          (char) 24471, (char) 30021, (char) 24555, (char) 12290, (char) 19981, (char) 36807,
                                          (char) 65292, (char) 19968, (char) 38388, (char) 25151, (char) 20869, (char) 33509,
                                          (char) 20840, (char) 37096, (char) 20351, (char) 29992, (char) 20919, (char) 33394,
                                          (char) 65292, (char) 25110, (char) 20840, (char) 37096, (char) 37319, (char) 29992,
                                          (char) 26262, (char) 33394, (char) 65292, (char) 20250, (char) 20351, (char) 20154,
                                          (char) 24863, (char) 21040, (char) 19981, (char) 23433, (char) 12290, (char) 26368,
                                          (char) 22909, (char) 26159, (char) 30830, (char) 23450, (char) 20027, (char) 33394,
                                          (char) 21518, (char) 65292, (char) 23567, (char) 38754, (char) 31215, (char) 20351,
                                          (char) 29992, (char) 20123, (char) 21576, (char) 40092, (char) 26126, (char) 23545,
                                          (char) 27604, (char) 30340, (char) 33394, (char) 24425, (char) 12290, (char) 20837,
                                          (char) 22799, (char) 36141, (char) 32622, (char) 19968, (char) 20123, (char) 33394,
                                          (char) 35843, (char) 28165, (char) 20937, (char) 30340, (char) 39280, (char) 29289,
                                          (char) 25670, (char) 35774, (char) 65292, (char) 26159, (char) 26368, (char) 30465,
                                          (char) 38065, (char) 26377, (char) 25928, (char) 30340, (char) 19968, (char) 25307,
                                          (char) 65292, (char) 22914, (char) 20026, (char) 21488, (char) 28783, (char) 25442,
                                          (char) 20010, (char) 30333, (char) 33394, (char) 28783, (char) 32617, (char) 12289,
                                          (char) 22312, (char) 27927, (char) 25163, (char) 38388, (char) 25918, (char) 19968,
                                          (char) 22871, (char) 20912, (char) 34013, (char) 33394, (char) 30340, (char) 27792,
                                          (char) 28020, (char) 29992, (char) 20855, (char) 31561, (char) 12290, (char) 20026,
                                          (char) 24744, (char) 25552, (char) 20379, (char) 29983, (char) 27963, (char) 21672,
                                          (char) 35759, (char) 24182, (char) 31069, (char) 24744, (char) 29983, (char) 27963,
                                          (char) 24841, (char) 24555, (char) 65281, (char) 22914, (char) 19981, (char) 24076,
                                          (char) 26395, (char) 25171, (char) 25200, (char) 35831, (char) 22238, (char) 22797}) +
                    "?NO?)http://www.blah.com/servlet/mailbox?item=fc-10Tq9aljw0w9.jpg";
            boolean isURL = text.matches(".*http\\S*(jpg|gif).*");
            System.out.println("isURL="+isURL+", length="+text.length());
    }Prints
    isURL=true, length=344

  • Expression Based Connection String Failing on Report Manager

    Hello,
    i have this report, where i want it the language selection to be dynamic. And so implemented the below expression, to my surprise everything works fine on BIDS but when i deploy to report Manager it errors out! (report manager language is en-US)
    ="Data Source=localhost;Initial Catalog=" & CHR(34) &"AdventureWorks
    DW SSAS" &CHR(34)&";Locale Identifier=" & switch(User!Language="en-US","1033")
    Any help would be greatly appreciated.
    Thanks,
    naveej

    Hi naveej,
    As per my understanding, connect string with “Locale Identifier” is used to select the language to make dataset return any translations we have present in the cube. The connect string which you posted is used to make the report with English language appears
    to the user. After testing the connect string in my environment, it works well. Even when the report manager use other language (not en-US), the report also work well. So I’m curious about what error you received, could you post it more detail?
    The following document about how language versions are used throughout a Reporting Services installation is for your reference:
    http://msdn.microsoft.com/en-us/library/ms156493.aspx
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to use regular expression to find string

    hi,
    who know how to get all digits from the string "Alerts 4520 ( 227550 )  (  98 Available  )" by regular expression, thanks
    br, Andrew

    Liu,
    You can use RegEx as   
    d+
    Whether you are using CL_ABAP_REGEX class then
    report  zars.
    data: regex   type ref to cl_abap_regex,
          matcher type ref to cl_abap_matcher,
          match   type c length 1.
    create object regex exporting pattern = 'd+'
                                  ignore_case = ''.
    matcher = regex->create_matcher( text = 'Test123tes456' ).
    match = matcher->match( ).
    write match
    You can find more details regarding REGEX and POSIX examples here
    http://www.regular-expressions.info/tutorial.html

  • Maybe you are looking for

    • Why Can't I make a New Graphic Style in Illustrator CC?

      Why Can't I make a New Graphic Style in Illustrator CC? Nothing works. I've tried several options to make a Graphic Style. Even tried to copy another and change it. Kindly Regards Christina Saugmann

    • Interactive Reporting - Counting Records in a Non-numeric Column

      I have created a report that shows open trouble tickets, the group they are assigned to and the status of the ticket. I would like to create another report based on the first one that shows each group and the number of tickets they have in each statu

    • Aironet 1261 AP Problem with speed.

      Hi guys, I appreciate I am not Cisco trained and probably should have never purchased such a piece of kit, but my SMB run from home needed stability so I thought I would try to enter the world of Cisco. I have spent the week setting up the Aironet AP

    • First PKGBUILD, no success

      Could anyone kindly help me out? I'm trying to make a PKGBUILD with little success. https://aur.archlinux.org/packages/tbs-linux-drivers/ It should build some drivers + install them and some firmware to /usr/lib/firmware/

    • Trouble in runclient on SavingsAccount example

      I am following the J2EE Tutorial. I'm on the j2eetutorial/doc/BMP2.html#63189 part of the tutorial. Not sure what does Binding name:`java:comp/env/ejb/SimpleSavingsAccount` means. I didn't recompile the SavingsAccount example when using the "deployto