Reg Exp always returning false value

Hi,
Below is my code. I want to restrict the values to only alphabets and numbers and not special char.
But the below condition fails on a positive value also. Ex: ABCD, abcd, 1234. These should be acceptable.
Is the reg exp wrong?
private var special_char:RegExp = /^[A-Za-z0-9]*$/;
                              private function validateSpecialChar(inputValue:String):Boolean {
                                        if (special_char.test(inputValue))
                                                  valid = true;
                                        else
                                                  valid = false;
                                        return valid;
Thanks,
Imran

Try: http://stackoverflow.com/questions/9012387/regex-expression-only-numbers-and-characters

Similar Messages

  • SelectInputMethod() method of InputContext always returning false in JWS

    Hi,
    I am setting the Locale on a textArea using the api:
    TextArea.getInputContext().selectInputMethod(Locale).
    This api is always returning false, when run on Java Web Start.
    However, it returns the correct value, when run on Java.
    Has any one faced such issue?
    Thanks,
    Charanjeet
    Message was edited by:
    jannyguy

    When I trace the nativePath of the file I am trying to find it shows "C:\Users\User\AppData\Roaming\Arakaron.debug\Local Store". This is the exact path I am following in Explorer. Now, instead of applicationStorageDirectory I can do documentsDirectory and it reads that the file is in fact there. With the applicationStorageDirectory it only registers that the file exists after I copy from the embedded db file. 

  • DataLine isRunning() always returns false for mp3 files

    Running JDK 1.5.0-b64 on Win 2K and XP. Using the sun mp3 plug-in. Everything works except the DataLine.isRunning() method always returns false.
    For other file types (e.g. WAV) isRunning() returns true/false values as you might expect.
    Anybody else have this experience? It seems like a bug to me.
    Thank you.

    Running JDK 1.5.0-b64 on Win 2K and XP. Using the sun mp3 plug-in. Everything works except the DataLine.isRunning() method always returns false.
    For other file types (e.g. WAV) isRunning() returns true/false values as you might expect.
    Anybody else have this experience? It seems like a bug to me.
    Thank you.

  • Businessobject.isValid always returns false

    Hi,
    I have created an object against to BOXXXXX business object by using below method having all the input values to formal arguments.
    CreateAction(actType As String,sfakna1 As String,Date1 As Date,Date2 As Date,description As String) As BusinessObject
    Dim boActivity As BusinessObject
    boAction = BusinessRootObject.BusinessFactory.CreateBusinessObject("BOXXXXX", "")
    We have some mandatory attributes and some normal attributes in BOXXXXX. We are setting values for all the mandatory attributes and setting 5 values to normal attributes. by using this code.
    With boActivity
                 ''''Normal attributes
                .SetAttribute("A", False)
                .SetAttribute("C", sfakna1)      
                .SetAttribute("D", description)
                .SetAttribute("E", Date1)    
                .SetAttribute("F", Date2)
                ''Mandatory attributes.
                .SetAttribute("F", "1")      
                .SetAttribute("G", "ABC")         
                .SetAttribute("H", "ACT")        
                .SetAttribute("B", actType)    
            End With
    But during verifying the boAction which always returns false in below condition.
           If boAction.IsValid() Then
           End if
    Please provide me the way to make that boAction returns true.
    Thanks in advance.
    Thanks,
    Naidu

    Thanks Shankar for your prompt response.
    Verified that we have set same lengh in our input parameters as in businessobject and verifed that each attribute(normal+mandatory) returns true. Verified with individually by using the below code.
    boAction.IsValidAttribute("A")  ''Normal
    boAction.IsValidAttribute("F")   ''Mandatory
    We have included all the mandatory fields in our function with same data types and same properties.
    Please suggest  me the inputs and share me the code if any to findout the causing attribute which makes boAction.IsValid() condition false.
    Thanks in advance
    Regards,
    Naidu

  • Default hostnameverifier always returns false ...

    Hi,
    I am trying to run wsdl2java by supplying an https URL. The JVM args that I am using are:
    javax.net.ssl.trustStore=E:/Romil/projects/AirDeccanPlugin/localhost.ks
    java.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol
    On running wsdl2java, I end up getting the following exception:
    java.io.IOException: wrong hostname : should be <...>
    I've verified that the hostname (IP address) in the URL exactly matches the CN (IP address) in the server certificate .
    When I look at the JSSE code, it seems like the default HostnameVerifier always returns "false".
    I also couldnt figure out a non-programatical way of supplying my own
    HostnameVerfier to JSSE that returns a "true"
    Any solutions/thoughts ?
    Thanks and regards,
    Romil

    try this code before creating a connection
    com.sun.net.ssl.HostnameVerifier hv=new com.sun.net.ssl.HostnameVerifier() {
    public boolean verify(String urlHostname, String certHostname) {
    System.out.println("Warning: Hostname is not matched for cert: "+urlHostname+ certHostname);
    return true;
    com.sun.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(hv);
    this should solve your problem
    cheers

  • ServletAuthentication.weak() makes isUserInRole() always return false

    I have a problem with SSO and authentification. If I authenticate with the weak()
    method(have tried alle of them) authentication works fine and it seem to be single
    signed-on, but
    if we call the isUserInRole() method it always return false.
    If I try to "call" pages from the client the declerativ security-constraints also
    works fine preventing the user from accessing the pages. It is only when we use
    the forward() method that we also use isUserInRole() to check if the user is permitted
    to be forwarded(). WLS 6.1 sp2 tells us that the user is never in Role, no matter
    what, if we use the weak() method to authenticate.
    If I switch to using a j_sec_check form to authenticate the isUserInRole() works
    fine. I can't use j_sec_check as a permanent solution though, because I need to
    do a lot of pre- and post- processing in the login/authenication process.
    Have any of you figured out a solution to this problem? Shouldn't isUserInRole()
    work the same way regardless of if you logged in using SA.weak() or a j_security_check
    form?

    Hi ,
    If I switch to using a j_sec_check form to authenticate the isUserInRole()works
    fine. I can't use j_sec_check as a permanent solution though, because Ineed to
    do a lot of pre- and post- processing in the login/authenication process.You can use the j_security_check and still do the pre and post processing as
    you want.
    You have to following code,
    package examples.servlets;
    import java.io.PrintStream;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import weblogic.servlet.security.AuthFilter;
    public class AuthFilterImpl extends AuthFilter
    public AuthFilterImpl()
    System.out.println("New AuthFilterImpl has been created.");
    public void doPreAuth(ServletRequest servletrequest, ServletResponse
    servletresponse)
    System.out.println("AuthFilterImpl.doPreAuth has been called.");
    System.out.println("Password is " +
    servletrequest.getParameter("j_password"));
    public boolean doSuccessAuth(ServletRequest servletrequest,
    ServletResponse servletresponse)
    System.out.println("AuthFilterImpl.doSuccessAuth has been called.");
    return true;
    public void doFailAuth(ServletRequest servletrequest, ServletResponse
    servletresponse)
    System.out.println("AuthFilterImpl.doFailAuth has been called.");
    In your weblogic.xml have this entry,
    <weblogic-web-app>
    <auth-filter>
    examples.servlets.AuthFilterImpl
    </auth-filter>
    </weblogic-web-app>
    I am not sure about problem with SA.weak().
    -utpal
    "Morten" <[email protected]> wrote in message
    news:[email protected]...
    >
    I have a problem with SSO and authentification. If I authenticate with theweak()
    method(have tried alle of them) authentication works fine and it seem tobe single
    signed-on, but
    if we call the isUserInRole() method it always return false.
    If I try to "call" pages from the client the declerativsecurity-constraints also
    works fine preventing the user from accessing the pages. It is only whenwe use
    the forward() method that we also use isUserInRole() to check if the useris permitted
    to be forwarded(). WLS 6.1 sp2 tells us that the user is never in Role, nomatter
    what, if we use the weak() method to authenticate.
    If I switch to using a j_sec_check form to authenticate the isUserInRole()works
    fine. I can't use j_sec_check as a permanent solution though, because Ineed to
    do a lot of pre- and post- processing in the login/authenication process.
    Have any of you figured out a solution to this problem? Shouldn'tisUserInRole()
    work the same way regardless of if you logged in using SA.weak() or aj_security_check
    form?

  • How to redefine _isAutoCompleteDisabled() to always return false?

    I would like to redefine _isAutoCompleteDisabled() to always return false. I find the definition inside omni.jar in the file nsLoginManager.js. If I rename omni.jar to omni.zip, I can see the contents, but if I try to drag an updated nsLoginManager.js to the archive, Windows 7 complains the archive is corrupt. I tried putting an extra copy of nsLoginManager.js into the components directory, but it did not override the other definition.
    How can I redefine _isAutoCompleteDisabled() to always return false?

    You can look at /questions/799489

  • PartialPageUtils.isPartialRequest(fctx) always return false

    Hi All ,
    I am using Jdeveloper 11g and i can't solve the problem with getting always false from
    PartialPageUtils.isPartialRequest(fctx);
    If i use partialSubmit="true" PartialPageUtils.isPartialRequest(fctx) return false.
    If i don't use partialSubmit PartialPageUtils.isPartialRequest(fctx) return false.
    Could you please give me a solution.
    Thanks in advance,
    JavaDeveLoper

    Hi Mr. Frank Nimphius
    I have a creation form with 7 input text fields. 3 of them are required fields.
    These 3 fields have valueChangeListener , validator and autoSubmit="true".
    The problem is that when i enter info in field 1 and tab to the next field after passing the validator for field1 i get error message, because i've entered nothing in the other required fields.
    Also i've ovveride public void validateModelUpdates(LifecycleContext lifecycleContext) {...}
    public void validateModelUpdates(LifecycleContext lifecycleContext) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    boolean isPPR = PartialPageUtils.isPartialRequest(fctx);
    if (isPPR) {
    System.out.println("No Refresh");
    } else {
    super.validateModelUpdates(lifecycleContext);
    This method always return false.

  • IsInt() always returns false

    Why does the following code always return false:
         public static boolean isInt(String[] input)
                   String temp="";
                   int isInt=0;
                   for(int i=0;i<input.length;i++)
                        for(int j=0;j<input.length();j++)
                             for(int k=0;k<10;k++)
                                  temp=String.valueOf(k);
                                  if(!(input[i].charAt(j)==temp.charAt(0)))
                                       isInt=0;
                                  else
                                       isInt=1;
                             if(isInt==0)
                                  return false;
                   return true;
              }? Thanks! :)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    TuringPest wrote:
    BigDaddyLoveHandles wrote:
    Are you checking to see if all the strings are comprised of only decimal digits? Sounds like a job for regex, eh?
    Or the tres magical [Character.isDigit()|http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html#isDigit(char)]
    Specially if you are expecting Devanagari digits!
    or [Integer.parseInt()|http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#parseInt(java.lang.String)]!
    That was my next question -- what about string
    "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"

  • Compare always returns false

    can anyone see why this always returns false     regardless of ObservedType??
    <cfset isNullfwdExtraWindow = false>
        <cfif arguments.trade.ObservedType eq 'C'>
            isNullfwdExtraWindow = true>
        </cfif>
        <cfif arguments.trade.ignoreBarrierStyleAndObserved>
            isNullfwdExtraWindow = true>
        </cfif>

    nikos101 wrote:
    can anyone see why this always returns false     regardless of ObservedType??
    <cfset isNullfwdExtraWindow = false>
        <cfif arguments.trade.ObservedType eq 'C'>
            isNullfwdExtraWindow = true>
        </cfif>
        <cfif arguments.trade.ignoreBarrierStyleAndObserved>
            isNullfwdExtraWindow = true>
        </cfif>
    This code misses the cfset tag. You could try something like
    <cfset isNullfwdExtraWindow = false>
    <cfif trim(arguments.trade.ObservedType) eq 'c' OR arguments.trade.ignoreBarrierStyleAndObserved>
         <cfset isNullfwdExtraWindow = true>
    </cfif>

  • Mkdir() always return false

    Hi all,
    I just want to create a directory from a standalone appli but the code below always return "8-("... Of course I have the rights to create/delete files because it is my C: drive.
    Thanks in advance for your help.
    String expDir = "C:\\mydir\\temp";
    File fDir = new File (expDir);
    boolean dirmade = false;
    if (!fDir.exists()){
        System.out.println( "try to create dir: "+ expDir);
        dirmade = fDir.mkdir();
        if (dirmade)
            System.out.println( ":-))");
        else
            System.out.println( "8-(");
    else{
        System.out.println( "dir already exists");
        }

    Hi!
    The method mkdir() only creates one directory! So if the directory c:\mydir does not exist, the method doesn't work.
    Use mkdirs() instead.
    Johannes

  • Iam Using Gridview Cell Click Event to Check the Checkbox Status of the GridViewCheckboxCell. But It Always Return False Even it is Checked

      private void GridViewRoom_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
                  if (e.ColumnIndex==19)
                       bool isChecked = Convert.ToBoolean(GridViewRoom.CurrentRow.Cells[e.ColumnIndex].Value);   // It Return False only, Even If it is Checked

    Telerik is a 3rd party company, please use their forums if you need help with using their controls:
    http://www.telerik.com/forums

  • NativeProcess.isSupported always return false

    Hi,
    when i do this trace(NativeProcess.isSupported) it always retun false. I run the code on flash cs5 AIR 2.0. Then i publish as .air file and it again it gave the 'false' as result. I checked the xml file it have tag "<supportedProfiles>desktop extendedDesktop </supportedProfiles>". Then i tryed the same from flash cs6 AIR 3.2 again the same 'false' result.
    What is the problem? What should i do to get the result as 'true'?
    Here is the xml file generated from flash CS5:
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <application xmlns="http://ns.adobe.com/air/application/2.0">
      <id>test</id>
      <version>1.0</version>
      <filename>test</filename>
      <description/>
      <name>test</name>
        <copyright/>
       <initialWindow>
        <content>test.swf</content>
        <systemChrome>standard</systemChrome>
        <transparent>false</transparent>
        <visible>true</visible>
        <fullScreen>false</fullScreen>
        <aspectRatio>portrait</aspectRatio>
        <renderMode>auto</renderMode>
      </initialWindow>
      <icon/>
      <customUpdateUI>false</customUpdateUI>
      <allowBrowserInvocation>false</allowBrowserInvocation>
      <supportedProfiles>desktop extendedDesktop </supportedProfiles>
    </application>
    Thanks
    Siva

    NativeProcess:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativePro cess.html
    The NativeProcess class and its capabilities are only available to AIR applications installed with a native installer (extended desktop profile applications)
    Your descriptor file makes your app both desktop and extendedDesktop. Remove desktop because it is not supported with that.
    <supportedProfiles>extendedDesktop</supportedProfiles>
    Using both profiles:
    Using just extendedDesktop:

  • Boolean always returning false;

    Ok so i have this
    public static boolean testAuth(){
              try{
                   BufferedReader authReader = new BufferedReader(new FileReader("auth.txt"));
                   String auth = authReader.readLine();
                   authReader.close();
                   URL authUrl = new URL("http://hvc3.com/authTest.php?auth="+auth);
                   BufferedReader urlReader = new BufferedReader(new InputStreamReader(authUrl.openStream()));
                   String authResponse = urlReader.readLine();
                   System.out.println(authResponse);
                   if(authResponse == "active"){
                        return true;
                   }else{
                        return false;
              }catch (IOException e){
                   return false;
         }this is my console outpot:
    kevin-roses-computer:~/Desktop kevinrose$ java test
    active
    NOO
    sorry its not the exception i dot knw whats wong:
    Message was edited by:
    krrose27

    if(authResponse.equalsIgnoreCase("active"))
    {And in this case just write:
    return authResponse.equalsIgnoreCase("active");:-)
    -Puce

  • GSSContext.isEstablished() always return false

    I'm writing a servlet filter for Kerberos single-signon between IE and websphere 5 on Win2000 through JGSS-API and SPNEGO. I use com.ibm.security.auth.module.Krb5LoginModule as the login module and I've created the keytab and put in the app. server. I can see that the Kerberos credentials is retrieved from the keytab and Login is sucessful. When I call gsscontext.acceptSecContext(), a token (should be AP-REP) is returned. I checked gsscontext.isEstablished() and it returns false. So, I wrap this token in a NegTokenTarg with status "accept_incomplete" and send it back to the browser. However, the browser send the same request over and over again and the context is never established.
    Here's the extract of the browser request keep receiving:
    A1 82 04 D3 (NegTokenTarg - 0xa1)
    30 82 04 CF (sequence)
    A2 82 04 CB (sequence element 2 - response token)
    04 82 04 C7
    60 82 04 C3
    06 09 2A 86 48 86 F7 12 01 02 02
    01 00 6E 82 04 B2 30 82 04 AE A0 03 02 01 05 A1 03 02 01 0E A2 07 03 05 00 20 00 00 00 A3 82 03 D6 61 82 03 D2 30 82 03 CE A0 03 02 01 05 A1 10 1B 0E 44 4D 5F 43 42 ...
    Here's the extract of my response to the browser:
    A1 82 01 42 (NegTokenTarg - 0xa1)
    30 82 01 3E (sequence)
    A0 03 0A 01 01 (sequence element 0 - negResult accept_incomplete)
    A1 0B 06 09 2A 86 48 86 F7 12 01 02 02 (sequence element 1 - supported mech)
    A2 82 01 28 (sequence element 2 - response token)
    04 82 01 24
    60 82 01 20
    06 09 2A 86 48 86 F7 12 01 02 02
    03 00 7E 82 01 0F 30 82 01 0B A0 03 02 01 05 A1 03 02 01 1E A4 11 18 0F 32 30 30 35 30 33 30 31 30 36 31 37 35 33 5A A5 05 02 03 05 24 68 A6 03 02 01 00 A9 10 1B 0E ...
    It seems that the NegTokenTarg from browser contains only the responsetoken. There's no negResult in it.
    Any help would be appreciated!

    NativeProcess will not work in a .air file. You will have to create a native installer for the undelying platform for NativeProcess to work.
    You may find some help at:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativePro cess.html
    For testing purpose only, you can use adl -profile extendedDesktop <path to app descriptor> <path to swf>
    Hope this helps,
    Neha

Maybe you are looking for

  • How do you take pictures from one library and put in another library??

    How do you take pictures from one library and put in another library??

  • How do I recover windows 7 partition after OSX 10.9.1 update from Snow?

    I started Boot Camp Assistant and tried to "Download the latest Windows support software from Apple" option. During the "Task Status" it said that only Windows 7 was supported on my iMac. I continued with "ok". Then I got an error message "Can't inst

  • BAPI reverse document for JVA company

    Hi I want to use a bapi to reverse documents. I have tried with BAPI_ACC_INVOICE_REV_POST for reversing an invoice receipt. The company use Joint Venture Accounting. When I run the bapi I get the error: 630 'Reversal in component JVA not possible'. T

  • Update descriptions on Apple site with no download button

    Hello, I found this update for OS X about the Flashback trojan and for some reason there is no download button for it : http://support.apple.com/kb/HT5242 For comparaison / example, this one has a download button : http://support.apple.com/kb/DL1517

  • I need help with ipod games...

    Dear other Itunes users, I have multiple libraries that I currently use. The problem is not that I can not successfully get the games on the ipod, but that all the games(purchased on different computers) cannot coexist on the ipod. The message warns