Regex using Unicode values

Hi,
I have the following javascript
function isArabicSymbols( objValue ) {
var validPattern = /[\u0621-\u064A]/;
if (!validPattern.test( objValue ))
return false;
return true;
I want to write the same code in java using java regex
public class TestChar
public static void main(String args[])
java.util.regex.Pattern p = java.util.regex.Pattern.compile("[\u0621-\u064A]");
java.util.regex.Matcher m = p.matcher("��������");
System.out.println ("Check : " + m.matches());
This doesn't seem to work. Could you please help me in writing similar function in java.
Thanks & Regards
Sandhya

This doesn't seem to work.Could you elaborate?
Tell me if I'm wrong, but it seems like your range goes from ARABIC LETTER HAMZA to ARABIC LETTER YEH. Is that what you really want?
And, as said in previous replies, your pattern means one character in the range (add a '+' if you want to match a sequence of at least one character.)
Example:java.util.regex.Pattern p = java.util.regex.Pattern.compile("[\u0621-\u064A]+");
java.util.regex.Matcher m = p.matcher("��������");
System.out.println ("Check : " + m.matches());
m = p.matcher("\u0621\u0639");
System.out.println ("Check : " + m.matches());This will outputs:
Check : false
Check : true

Similar Messages

  • Not able to display data in separate columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.
    This is an urgent need. Please help me out.

    Hi,
    I have no problem with item :P15_EV_LCL this is having a value my probem here is i am using java script to display the value in different color based on the condtion case
    eg:
    select
    case
    TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2)
    = :P15_EV_LCL
    then
    span style="background-color:lightgreen"
    || TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    else
    span style="background-color:yellow"
    || TRUNC(
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    end "Effort"
    from actuals Z
    If i dont use this <Span style="Background-color:color"> i am able to generate data in excel sheet if i use this color coding i am not able to get data in spread sheet.
    Please suggest
    Thanks
    Sudhir
    Edited by: Sudhir_N on Mar 23, 2009 10:00 PM

  • How to display unicode values in file to corresponding characters

    Hello Java-ians !
    Could you please calrify my doubt ! I am able to generate unicode values for arbic, russian characters. I did it by generating a UTF-8 format file and I used native2ascii tool to generate unicode values. No I am unable to dispaly the characters. I read the file using FileReader and used JTextFiled.setText method to redisplay the characters. Instead of displaying the corresponding character, I am getting only unicode values. Why it's happening ?
    Also could you plese tell me how ResourceBundle works ? It reads the unicode values and displays proper charcters, how ?
    Please help me ! I need it desperately !
    Martin Sunder Singh D.S.

    you have to do like this:
    FileInputStream fos = new FileInputStream(new File("japanies.out"));
    BufferedReader bw = new BufferedReader(new InputStreamReader(fos,"UTF8"));
    System.out.println(bw.readLine());
    bw.close();

  • ADFS Active Authentication SAML token with unicode values throwing error when post to _trust end point in SharePoint

    Hi All,
    I have a SP2013 environment which authenticate users using ADFS 2.0 via Windows AD. We have two separate clients, Portal and Mobile. Portal users Passive Federation where as Mobile client uses Active Authentication with usernamemixed endpoint in ADFS. 
    I have an AD property which stores Unicode characters. In Active Authentication via Mobile, for a user who has a Unicode value in the AD property, I can get the SAML token successfully from ADFS. 
    Ex : <saml:AttributeValue>español</saml:AttributeValue>
    However, when I post this SAML token to SharePoint _trust endpoint, I'm getting an error "500 Internal Server error". However for the same user, if I change the AD property value from "español" to "English" then I can get the FedAuth
    cookie successfully from the _trust endpoint. 
    Also, for the same user, If I logged in via Portal which uses Passive Federation, then it's working fine.
    Really appreciate your thoughts on this.
    Supun

    Hi Supun,
    As you mentioned, the issue only happens in Active authentication. Would you please let me know which mobile client your users are using for the Active authentication, is it a custom one? Please be noted if you use a mobile browser, the authentication will
    also be Passive.
    In Passive mode authentication, STS also uses POST to pass the security token to the relaying party. I'd like to know what kind of tool you are using to post a SAML token to SharePoint endpoint as impersonation of an Active authentication. Since the Active
    authentication flow is quite complex, I also suggest you to check the event log in your ADFS server, and try to find more information about the issue.
    Thanks,
    Reken Liu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Unicode value of a non-ASCII character

    Hi,
    Suppose, the unicode value of the character &#2381; is '\u094d'.
    Is there any Java function which can get this unicode value of a non-ASCII character.
    Like:
    char c='&#2381;';
    String s=convertToUnicode(c);
    System.out.println("The unicode value is "+ s);
    Output:
    The unicode value is \u094d
    Thanks in advance

    Ranjan_Yengkhom wrote:
    I have tried with the parameter
    c:\ javac -encoding utf8 filename.java
    Still I am getting the same print i.e. \u3fIf it comes out as "\u3f" (instead of failing to compile or any other value), then your source code already contains the question mark. So you already saved it wrong and have to re-type it (at least the single character).
    >
    Then I studied one tutorial regarding this issue
    http://vietunicode.sourceforge.net/howto/java/encoding.html
    It says that we need to save the java file in UTF-8 format. I have explored most of the editors like netbean, eclipse, JCreator, etc... there is no option to save the java file in UTF-8 format.That's one way. But since that is so problematic (you'll have to remember/make sure to always save it that way and to compile it using the correct switch), the better solution by far is not to use any non-ASCII characters in your source code.
    I already told you two possible ways to achieve that: unicode escapes or externalized strings.
    Also read http://www.joelonsoftware.com/articles/Unicode.html (just because it's related, essential information and I just posted that link somewhere else).

  • How to fill an oracle CLOB with a XML document using Unicode UTF8

    Hi,
    I'm working with C# and oracle database v8.1.7 (release 3), and i'm having some problems to fill correctly an oracle CLOB parameter with XML document using UTF8 encoding.
    It works fine with "Encoding.Unicode" but not with "Encoding.UTF8". The problem is that i can't use Unicode (UTF16) with oracle 8.
    Can someone help me ? Thanks.
    Here is my code.
    OracleTransaction tx = conn.BeginTransaction();
    OracleCommand cmd = conn.CreateCommand();
    cmd.Transaction = tx;
    cmd.CommandText = "declare xx clob; begin dbms_lob.createtemporary(xx, false, 0); :tempclob := xx; end;";
    cmd.Parameters.Add(new OracleParameter("tempclob", OracleType.Clob)).Direction = ParameterDirection.Output;
    cmd.ExecuteNonQuery();
    OracleLob tempLob = (OracleLob)cmd.Parameters[0].Value;
    MemoryStream MemStrm = new MemoryStream();
    XmlTextWriter writer = new XmlTextWriter(MemStrm, Encoding.UTF8);
    writer.Formatting = Formatting.Indented;
    WriteXMLExample(writer, "MSFT", 74.125, 5.89, 69020000);
    writer.Close();
    cmd.Parameters.Clear();
    cmd.CommandText = "test_xml";                    
    cmd.CommandType = CommandType.StoredProcedure;
    tempLob.Write(MemStrm.GetBuffer(), 0, MemStrm.GetBuffer().Length );
    tempLob.Position = 0;
    cmd.Parameters.Add(new OracleParameter("xml_inout", OracleType.Clob)).Value = (OracleLob) tempLob;
    cmd.ExecuteNonQuery();
    Console.WriteLine( "Param 0 = " + cmd.Parameters[0].Value.ToString() );
    tx.Commit();

    Hi,
    I'm working with C# and oracle database v8.1.7 (release 3), and i'm having some problems to fill correctly an oracle CLOB parameter with XML document using UTF8 encoding.
    It works fine with "Encoding.Unicode" but not with "Encoding.UTF8". The problem is that i can't use Unicode (UTF16) with oracle 8.
    Can someone help me ? Thanks.
    Here is my code.
    OracleTransaction tx = conn.BeginTransaction();
    OracleCommand cmd = conn.CreateCommand();
    cmd.Transaction = tx;
    cmd.CommandText = "declare xx clob; begin dbms_lob.createtemporary(xx, false, 0); :tempclob := xx; end;";
    cmd.Parameters.Add(new OracleParameter("tempclob", OracleType.Clob)).Direction = ParameterDirection.Output;
    cmd.ExecuteNonQuery();
    OracleLob tempLob = (OracleLob)cmd.Parameters[0].Value;
    MemoryStream MemStrm = new MemoryStream();
    XmlTextWriter writer = new XmlTextWriter(MemStrm, Encoding.UTF8);
    writer.Formatting = Formatting.Indented;
    WriteXMLExample(writer, "MSFT", 74.125, 5.89, 69020000);
    writer.Close();
    cmd.Parameters.Clear();
    cmd.CommandText = "test_xml";                    
    cmd.CommandType = CommandType.StoredProcedure;
    tempLob.Write(MemStrm.GetBuffer(), 0, MemStrm.GetBuffer().Length );
    tempLob.Position = 0;
    cmd.Parameters.Add(new OracleParameter("xml_inout", OracleType.Clob)).Value = (OracleLob) tempLob;
    cmd.ExecuteNonQuery();
    Console.WriteLine( "Param 0 = " + cmd.Parameters[0].Value.ToString() );
    tx.Commit();

  • How to use Unicode characters with TestStand?

    I'm trying to implement the use of Greek characters such as mu and omega for units. I enabled multi-byte support in the station options and attempted to paste some characters in. I was able to paste the mu character (μ) and import it from Excel with PropertyLoader. However, I have not had any luck with omega (Ω). I found the HTML codes for these characters on a web page (http://www.hclrss.demon.co.uk/unicode/) so I could use those codes for HTML reports, but that won't work for database logging, nor does it display the characters correctly for the operator interface. The operator interface is not a major problem, but the database must have the correct characters for customer reports. Anyone know how to do this? D
    oes database logging support Unicode for stored procedure calls to Oracle?

    Hello Mark -
    At this time TestStand has no unicode support. The multi-byte support that we do offer is based on the Windows architecture that handles Asian language fonts. It really isn't meant to provide a bridge for unicode values in TestStand. Certainly, your Operator Interface environment will have its own support level for unicode, i.e. at this time neither LabWindows/CVI version 6.0 nor LabVIEW 6.1 officially support unicode characters. This is why you will see that the units defined in the TestStand enumerators are all text-based values.
    I have run a quick test here, probably similar to what you were doing on your end, and I am uncertain if you will get the database behavior you want from TestStand. The database logging steps and API all use basic char sty
    le strings to communicate to the driver. Even though you are reading in a good value from Excel, TestStand is interpreting the character as the nearest ASCII equivalent, i.e. "Ω" will be stored and sent to the database as "O". If you have a stored proceedure in Oracle that is calling on some TestStand variable or property string as an input, then it is doubtful you will get correct transmission of the values to the database. If your stored proceedure could call into a spreadsheet directly, you would probably have better luck.
    Regards,
    Elaine R.
    National Instruments
    http://www.ni.com/ask

  • Unicode value of invisibles

    Hi,
    I have an XML file that contains an invisible, which when imported to Indesign CS turns into a Soft Return.
    How can I determine the Unicode value of that character in the XML file?
    Problem being, if I create a new XML file and use "\n" as my Soft Return character it becomes a Hard Return when imported.
    Bye
    SteveH

    Easiest way would be to load the file into a hex editor, I think.

  • How do I prove java uses unicode?

    Hi!
    I use a win98 computer in sweden with ansi cp1252.
    i run java in jbuilder 5.0 with jdk 1.3.0.
    I want to prove that java uses unicode and not the ascii tabell but if i try to write all char in a for loop for example i only get the ansi values. I want to prove that it uses unicode how can i do that?
    I have a suggestion that if i print a chinese sign for example that proves that java can handle many diffrent ascii tabells. but how do i do that and where should i put the font that is needed and where do i get it?
    Any suggestion for a solution ... plz message me :o)
    Anders.
    [email protected]

    The ASCI/ANSI character set is a subset of Unicode, so if you print all of them out you will just get the ASCII table. So, technically anything that uses Unicode uses the ASCII table. ;)
    Anyway, you can use the escape character \uXXXX where the X's are hexadecimal values. If you use a value greater than 255 than it will give you somthing that isn't ANSI. \u2122 is the trademark symbol, for example.
    I got this information from Core Java 2: Fundamentals if you're interested.

  • How to use Unicode strings for tool titles?

    So one of the few remaining Illustrator suites that does not accept ai::UnicodeString objects for arguments is AIToolSuite. I would really (really!) like to get some Unicode characters in some of my tool titles and tips, but figuring out what goes on behind the sAITool->AddTool() call, with its char* arguments, is tough.
    I have tried the obvious stuff, like passing UTF-8 multibyte data, which doesn't work. I have tried more nebulous approaches, like passing Z-string data with Adobe's strange way of "escaping" Unicode code points (they typically use "^U+1234" instead of the de facto "\u1234"), which doesn't work either.
    The result is that Unicode data either doesn't show at all, or shows as the typical Latin-based garbage full of diacritical marks (e.g. "éáÊöãÀ") which is nowhere near the original data that was passed in.
    Anybody have some insight?
    PS: I plan on filing a feature request shortly for ai::UnicodeString support in AIToolSuite, but until then...
    Thanks,
    - Garrett

    Hello Mark -
    At this time TestStand has no unicode support. The multi-byte support that we do offer is based on the Windows architecture that handles Asian language fonts. It really isn't meant to provide a bridge for unicode values in TestStand. Certainly, your Operator Interface environment will have its own support level for unicode, i.e. at this time neither LabWindows/CVI version 6.0 nor LabVIEW 6.1 officially support unicode characters. This is why you will see that the units defined in the TestStand enumerators are all text-based values.
    I have run a quick test here, probably similar to what you were doing on your end, and I am uncertain if you will get the database behavior you want from TestStand. The database logging steps and API all use basic char sty
    le strings to communicate to the driver. Even though you are reading in a good value from Excel, TestStand is interpreting the character as the nearest ASCII equivalent, i.e. "Ω" will be stored and sent to the database as "O". If you have a stored proceedure in Oracle that is calling on some TestStand variable or property string as an input, then it is doubtful you will get correct transmission of the values to the database. If your stored proceedure could call into a spreadsheet directly, you would probably have better luck.
    Regards,
    Elaine R.
    National Instruments
    http://www.ni.com/ask

  • Character Unicode Value

    Is it possible to have a VB script return the unicode values for a given range of characters in a paragraph or story?

    We tried it on a 8.1.7 database and I was not able to reproduce
    the error.
    Here is how I insert and retrieve the data:
    OraclePreparedStatement ps =
    (OraclePreparedStatement) conn.prepareStatement
    ("insert into tab01 values (?)");
    ps.setString(1, "\u2018");
    ps.executeUpdate();
    ps.close();
    ResultSet rs = (conn.createStatement()).executeQuery("select col01
    from tab01");
    while(rs.next())
    String str = rs.getString(1);
    System.out.println("COL01 is "+str);
    showUnicode("COL01 (Unicode Value) is "+str);
    (conn.createStatement()).close();
    conn.close();
    And here is the result from the database:
    SQL> select dump(col01, 16) from tab01;
    DUMP(COL01,16)
    Typ=1 Len=3: e2,80,98
    Are you using thin driver or oci driver?
    If oci driver is used, NLS_LANG needs to be set correctly and
    the Client OS code page must support these characters. Hope this
    helps.

  • How get English Charactor unicode value?

    I try to get charactor uni code value using following code. That code work for any other code excluding english.
    When i put english charactor it does not get unicode value. As a charactor it get charactor, but I insert Other charactor it get unicode value as char value.
    String temp = ;
    temp = temp.substring(1, temp.length());
    int temp_i = Integer.parseInt(temp, 16);
    Char c_UCPoints = (char) temp_i;English Input:
    temp = "\u002e"
    c_UCPoints = "." ---- but i want to get "\u002e"
    Tamil Input:
    temp = "\u0b89"
    c_UCPoints = "\u0b89" ----it show corect result
    Any one how to get that unicode value. reply this.

    You mean you want to manually convert to and from Unicode escapes? Try this: public class Test
      public static void main(String... args) throws Exception
        String chEsc0 = "\\u002e";
        char ch = (char) Integer.parseInt(chEsc0.substring(2), 16);
        String chEsc1 = String.format("\\u%04x", (int) ch);
        System.out.printf("%s => '%c' => %s %n", chEsc0, ch, chEsc1);
    } output: \u002e => '.' => \u002e

  • Can we use the value of a variable in an alert message

    I have a variable in forms6i. I want to use the value of this variable in an alert message. How is this possible?

    Gul wrote:
    I have a variable in forms6i. I want to use the value of this variable in an alert message. How is this possible?Try
    DECLARE err_txt VARCHAR2(200) t;
    al_id ALERT;
    al_button Number;
    BEGIN
    al_id := FIND_ALERT('My_Error_Alert');
    SET_ALERT_PROPERTY(al_id, alert_message_text, 'Hello how are you mr. variable '||:variable_name );
    al_button := SHOW_ALERT( al_id );
    END; Hope it works..
    Hamid

  • Not able to display data in different columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.

    Hi Venkat,
    After extracting data into DSO check the request whether active or not.
    Check data in DSO in contents.
    If is there any restrictions on info providers in Queries.
    Let us know status clearly.......
    Reg
    Pra

  • How to use Default value in a column in Tabular form in insertion or upda

    Hello,
    I am trying to use Default values so that user need not have to enter data, but when I select default type and put a default value, I see an error message, if I try to add a new row.
    How can I use a default value in a Column in a Tabular Form?
    Gouri
    Edited by: user1046395 on Apr 3, 2009 9:58 AM

    Gouri,
    You can just simply edit to each column's report attribute. For example,
    To set default date,
    Default Type: PL/SQL Expression of Function
    Default: sysdate
    To set default text,
    Default Type: PL/SQL Expression of Function
    Default: *'CLERK'*
    If you still have an error, what is the error message?
    Ittichai

Maybe you are looking for

  • How to repeat wireless signal using Airport Extreme as base, Netgear as repeater

    Some input and/or assistance is appreciated.  I purchased a new 802.11ac Airport Extreme.  I have an old Netgear wndr3300 (802.11n, 2.4 or 5GHz).  I'm trying to repeat the 2.4GHz using the Airport Extreme as the master router and the Netgear as the r

  • Dvd won't play in a PC

    My dvd's have always played in any dvd player, but often won't play in a pc computer, even though the computer plays commercial and/or other dvds. Is there a setting/region/selection to accommodate pc's? Thanks - Pat

  • Does iOS 5 support streaming from iTunes Match?

    Hi everyone, I'm considering signing up for iTunes Match,  I just have a question about the way it works in iOS 5. I have a 16GB iPhone with iOS 5, and the reason I'm wanting a cloud service is because I can't fit my music library on the iPhone itsel

  • No class def found error in web start console.

    I use visual J++ to code my applet and I compile it and it runs perfect on my hard drive. So I upload the html and the class file and all the images to my web directory and then go to my browser (IE) and load up the html and the applet fails to run.

  • Sharing Files Over a Network from an External Drive

    I have a Macbook Pro that is running 10.5.6, and I have, recently, acquired another Mac that is running 10.5.6, as well. I decided that I wanted to share some files from my Macbook Pro. The setup for file sharing is a breeze, but I am having some iss