Regexp for exclude special characters

hi!
i need a regular expression, which allows all chars and digits [A-Za-z0-9], without special characters like []@.
anyone can help me? thx!
bye,
christian

Hello Christian,
first throw of mine would look like something of this:
^[A-Za-z0-9]*$^ gives you the start
$ gives you the ending
* gives you zero or more repititions. You can replace this with {min,max}, which gives you a minimum and maximum length.
If you would like to know more about regular expressions this link might be useful for you.
Regards,
Tine

Similar Messages

  • RegExp for excluding special characters in a string.

    Hi All,
    Im using Flex RegExpValidator. Can anyone suggest me the correct expression to validate this condition?....
    I have tried this expression :----- /^[^///\/</>/?/*&]+$/...But in this it is also negating the alphabets.Also I have tried with opposite condition that in the String we should have alphabets and the expression is:-- ([a-z]|[A-Z]|[0-9]|[ ]|[-]|[_])*..... Please can anyone help me on this.
    Thanks in advanced to all.
    Munira

    sorry but you are posting things back that do not make any sense
    what do you mean with the below comment?
    munira06 wrote:
    Yes you are correct ,but I have tried this with single special character
    say
    Re: RegExp for excluding special characters in a string.
    here is a sample app taken from the live docs
    using ^[a-zA-Z0-9 \-_]*$ as the regex accepts all characters from a-z, A-Z, 0-9 - [space] and_
    run the example tell me what regex you are using and what test strings fail when they should pass or pass when they should fail
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Simple example to demonstrate the RegExpValidator. -->
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Script>
            <![CDATA[
                import mx.events.ValidationResultEvent;
                import mx.validators.*;
                // Write the results to the
                private function handleResult(eventObj:ValidationResultEvent):void {
                    if (eventObj.type == ValidationResultEvent.VALID) {
                        // For valid events, the results Array contains
                        // RegExpValidationResult objects.
                        var xResult:RegExpValidationResult;
                        reResults.text = "";
                        for (var i:uint = 0; i < eventObj.results.length; i++) {
                            xResult = eventObj.results[i];
                            reResults.text=reResults.text + xResult.matchedIndex + " " + xResult.matchedString + "\n";
                    } else {
                        reResults.text = "";
            ]]>
        </fx:Script>
        <fx:Declarations>
            <mx:RegExpValidator id="regExpV"
                    source="{regex_text}" property="text"
                    flags="g" expression="{regex.text}"
                    valid="handleResult(event)"
                    invalid="handleResult(event)"
                    trigger="{myButton}"
                    triggerEvent="click"/>
        </fx:Declarations>
        <s:Panel title="RegExpValidator Example"
                width="75%" height="75%"
                horizontalCenter="0" verticalCenter="0">
            <s:VGroup left="10" right="10" top="10" bottom="10">
                <s:Label width="100%" text="Instructions:"/>
                <s:Label width="100%" text="1. Enter text to search. By default, enter  a string containing the letters ABC in sequence followed by any digit."/>
                <s:Label width="100%" text="2. Enter the regular expression. By default, enter ABC\d."/>
                <s:Label width="100%" text="3. Click the Button control to trigger the validation."/>
                <s:Label width="100%" text="4. The results show the index in the text where the matching pattern begins, and the matching pattern. "/>
                <mx:Form>
                    <mx:FormItem label="Enter text:">
                        <s:TextInput id="regex_text" text="xxxxABC4xxx" width="100%"/>
                    </mx:FormItem>
                    <mx:FormItem label="Enter regular expression:">
                        <s:TextInput id="regex" text="ABC\d" width="100%"/>
                    </mx:FormItem>
                    <mx:FormItem label="Results:">
                        <s:TextInput id="reResults" width="100%"/>
                    </mx:FormItem>
                    <mx:FormItem >
                        <s:Button id="myButton" label="Validate"/>
                    </mx:FormItem>
                </mx:Form>
            </s:VGroup>
        </s:Panel>
    </s:Application>

  • Print preview for the special characters / symbols

    While displaying print preview / taking print output using QGA3 Transaction with developed Z SAPScript form specified as one of the parameters(say for example ZARMEXP), the special characters / symbols  like u2018∆u2019 are displayed as u2018#u2019 in the print preview / print output . Of course similar problem had existed for Lambda Symbol u2018u03BBu2019., but it was resolved by using the font type Helve_I7. But for the symbol u2018∆u2019 we checked with almost all the fonts that were available in the system, but of not much use. Hence could you kindly provide us solution(s) that would resolve this issue.

    Hi ,
    Can you please check language are installed properly in sap  check with basis people. then try to print it will work.
    when ever language are not maintin properly , the characters  or symbols are not print properly.
    Regars,
    Munibabu.k

  • Strategies for escaping special characters.

    Hi all,
    Our app(built using Workshop) needs to have a generic way of scrubbing special
    characters that a user might enter in the UI,and which might cause our sql that
    queries the DB to become malformed. To explain further,some of our DB controls
    are not using PreparedStatements to set Strings..instead, we are constructing
    the sql as a java string like:
    String myQuery="Select * from * where TOUPPER(name) like"+param.ToUpperCase().
    and then we do:
    Statement stmt=conn.createStatement();
    stmt.executeQuery(myQuery).
    In such cases, Oracle JDBC driver does not escape any special chars in the String
    param,and fails.Other than converting all our queries to use PreparedStatements,
    is there a generic pattern/Util class(mebbe RequestUtils) or some way of using
    the Servlet Filter API to scrub out any special chars that are input by the user?
    Thanks in advance.
    Vik.

    ServletFilter is the way to go on this one. Don't think there is anything built
    into Servlet spec that handles these characters, however, there are a number of
    sample filters that do such a task. I think there is a sample in either the O'Reilly
    book on Servlets or Core Servlets.
    "Vik" <[email protected]> wrote:
    >
    Hi all,
    Our app(built using Workshop) needs to have a generic way of scrubbing
    special
    characters that a user might enter in the UI,and which might cause our
    sql that
    queries the DB to become malformed. To explain further,some of our DB
    controls
    are not using PreparedStatements to set Strings..instead, we are constructing
    the sql as a java string like:
    String myQuery="Select * from * where TOUPPER(name) like"+param.ToUpperCase().
    and then we do:
    Statement stmt=conn.createStatement();
    stmt.executeQuery(myQuery).
    In such cases, Oracle JDBC driver does not escape any special chars in
    the String
    param,and fails.Other than converting all our queries to use PreparedStatements,
    is there a generic pattern/Util class(mebbe RequestUtils) or some way
    of using
    the Servlet Filter API to scrub out any special chars that are input
    by the user?
    Thanks in advance.
    Vik.

  • Excluding special characters.

    hi,
    i want to validating some fields and i want only alphabets to be entered.. it can be in lower case or upper case,
    but no special characters and numerics..
    wot can be done?

    Hi Sneha,
    When you will execute this code and you will put anything in parameter on selection screen you will get only alphabets.
    REPORT z_test.
    PARAMETERS: p_text(80) TYPE c DEFAULT 'R~a!m?m@o#h$a%n?4^5&j*A(G)A}N'.
    DATA: w_text(80) TYPE c VALUE
    'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    DATA: w_len TYPE i,
          w_off TYPE i.
    w_len = STRLEN( p_text ).
    DO w_len TIMES.
      w_off = sy-index - 1.
      IF w_text CS p_text+w_off(1).
      ELSE.
        p_text+w_off(1) = space.
      ENDIF.
    ENDDO.
    CONDENSE p_text NO-GAPS.
    WRITE : p_text.

  • FilenameFilter  regexp for exclude a file

    Hi,
    I have a little method which clears a directory by deleting all its content. Now I would like to be able to use a regular expression to control what I want to delete. Basically I want to delete all but one single file. For instance: suposse I have a directory with following files:
    foo1.txt
    foo2.ana
    foo.wav
    another.txt
    this_do_not_erase.wav
    another.wav
    and I would like to erase all but the one called "this_do_not_erase.wav". Is it possible to get a regular expression in Java to create a filenameFilter to be used with File.listFiles() method?
    I tried the following expression:
    "!"+ nameOfFile + "\\" wavExt "^.*"
    where nameOfFile variable contains the name of file to be kept in the directory and wavExt=".wav".
    Following is the function that erases all files in the directory:
    private static void clearDirectory(File directory, String regexp) throws SecurityException
    FilenameFilter filter = createFilter(regexp);
    File[] fileList = directory.listFiles(filter);
    for (int fileIdx = 0;fileIdx < fileList.length;fileIdx++)
    fileList[fileIdx].delete();
    The method I wrote to create the filenameFilter is the following:
    public static FilenameFilter createFilter(final String stringToMatch){
    FilenameFilter filter = new FilenameFilter() {
    public boolean accept(File dir, String name) {
    //return name.toLowerCase().contains(stringToMatch.toLowerCase());
    return name.toLowerCase().matches(stringToMatch.toLowerCase());
    return filter;
    Lots of thanks.

    From the description of wanting to exclude one specific file and delete the rest, I don't see why you'd need a regexp. That requirement would be solved by a filter that accepts all but a filename equal to the to be excluded file.
    But your file name filter can be a real class with all your desired functionality coded in, for example:
         public  class RegexpExcludingOneFileNameFilter implements FilenameFilter {
              private final String regexp;
              private final String excludeName;
              public RegexpExcludingOneFileNameFilter(String regexp, String fileToExclude) {
                   this.regexp = regexp;
                   excludeName = fileToExclude;
              @Override
              public boolean accept(File dir, String name) {
                   return name.matches(regexp) && !name.equals(excludeName);
         }You said somewhere that you want to change the fileToExclude every iteration, which to me means every pass through the loop and seems odd. But constructng a new filter each invocation of your clear method with the changing name of the file to keep looks straight forward to me...

  • How can we handle for german special characters for EXCEL -----URGENT

    HI All,
    I have report like to display data in more than one operating unit like german,us,spain.... etc
    I used the xml version like
    <?xml version="1.0" encoding="ISO-8859-1"?>
    and
    <?xml version="1.0" encoding="ISO-8859-2"?>
    In the above versions I am able to view the output well,but problem with the german/Spain letters.
    in place of germna letters .. it is displaying somethign others
    eg: 1.NYMPHENBURGER STR. 14 MÜNCHEN BAYERN 80335 Germany
    in excel report it is showing as
    NYMPHENBURGER STR. 14; MÃ?NCHEN;BAYERN;80335;GERMANY
    I registred the template with English Language and terrritory as United States..
    Result: I am able to view the ouput without any issues
    Issue: displaying other characters in place of German/Spain letters
    The report has the Customer Ship To address and Short descriptions ..
    please how can we fix this isssue.. it is very urgent for me
    Thanks,
    HTH
    Edited by: user9135824 on Nov 29, 2010 5:07 AM

    Hi All,
    Any body can provide the solution for this.
    Thanks in Advance

  • Mail for Exchange - special characters (umlaut) in...

    Hi,
    I have several usernames with german umlaut-characters (ü, ä, ö, ß). These usernames are not able to logon within Mail for Exchange. Is there any hint?
    M4E 1.06
    E60 3.0633.09.04

    Do you mean that you can not enter the characters in the username field or that it just doesn't work when you do?
    Which language are you using the phone in? Which language is Mail for Exchange in?

  • Check string for two special characters back to back

    Hey all so I need to check if a string has 2 backslashes back to back ("\\"). So the string "\\computername\c$\file" would match but the string "C:\file\path" would not. I've tried contains, match, and like. I've tried the code
    below which does work but gives me a false positive when I have a string like this "\computername\file\path".
    $com = "\\computername\C$"
    if($com -match "\\"){
    Write-Host true
    }else{
    Write-Host false
    Thanks for any help!

    In Regex ^ matches the starting position of a string. \ is a special character in Regex so you need to escape it with another \, so since you want double backslash \\, you need to escape twice \\\\, so ultimately ^\\\\ reads, at the start of the string
     find \\
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • How to use regular expression replace for this special characters?

    hi,
    I need to replace the below string, but i couldnt able to do if we use the special charaters '+', '$' . can anyone suggest a way to do this?
    select REGEXP_REPLACE('jan + feb 2008','jan + feb 2008', 'feb',1,0,'i') from dual
    anwers should be :- feb

    you should use escape character \.
    the regular expression will look like as follows:
    select REGEXP_REPLACE('jan + feb 2008','jan \+ feb 2008', 'feb',1,0,'i') from dual
    hope this is what you needed.
    cheers,
    Davide

  • JSP diplays shows junk for special characters.

    JSP Gurus,
    After upgrading the JRE version of my Tomcat from 1.3.1 to 1.4, all the JSP files have started displaying junk characters for the special characters (like ?, ?). These characters are being pulled from database. If I replace these characters with their ascii values, it works fine but there was no problem with the JRE 1.3.1. I have alot of data with these characters in the datbase. What is the easiest way to display these characters with JRE 1.4.
    Thanks,
    AG

    No One?!?

  • Dynamic insert for Special Characters

    Hello,
    I'm running into a problem inserting data with Special Characters. I have a report (designed oracle reports), that takes data and inserts the data into table. I use the SRW.do_sql built in package in a before report trigger to process the data. However the problem that I'm running into is how to dynamically account for the special characters in a description field that I have. There is no way for me to predict where or how many can appear in a field. For example, I may have a field that contains data like:
    O'REILLY AND ASSOCIATES INC.
    OR
    FULLER & D'ALBERT, INC.
    OR
    JOANNE'S BED & BACK SHOP
    The only special characters that seem to be used and are causing me problems are the " ' " and " & ".
    Does anyone know how I can dynamically account for these special characters in my insert statement?
    Thanks,
    Martin

    Hello,
    I'm using SRW.DO_SQL procedure in oracle reports because that is one you can run text via reports. The report actually exports the results to a text file and insert the results into a table. Anyway, the SRW.DO_SQL isn't my problem but rather the special characters. I have researched the problem some more and I have found a solution. You can use the "replace" feature to do an insert/update of special characters. You also need to find the character number for each special character. I believe "&" is chr(38), "%" is chr(37), "#" is chr(35), "@" is chr(64), "'" is char(39). So the code would be:
    insert into tableA (column1) values(
    replace(replace(replace(replace(replace(v_entity_name,chr(39),chr(39)),chr(38),chr(38)),chr(35),chr(35)),chr(37),chr(37)),chr(64),chr(64));
    Martin

  • New-MailboxSearch with AQS for special characters

    I've been asked to perform a specific query for a term with a leading dollar sign ('$'): $123,123.00.  When I run the query for a leading dollar sign the keyword search term in the result appears as:
    Body:',123.00' 
    It doesn't work if I use a backslash literal with the dollar sign either.  The result in the report is:
    Body:' \,123.00 ' 
    Searching for Body:'123,123.00$' works: 
    Body:'123,123.00$'
    How do I search for leading special characters? Would '*123,123.00*" find the string I am looking for?

    Hi,
    I have some tests in my lab:
    1. When I run the following cmdlet, it works. I recommend you run the following cmdlet to achieve your search.
    New-MailboxSearch -Name "1" -TargetMailbox
    [email protected] -SearchQuery "$ 123,123.00"
    2. When the SearchQuery is "\123,123.00", it also works.
    3. When the SearchQuery is "*123,123.00*", it occurs the error below: Suffix matching isn't supported. Please remove the prefix '*' or type another query. The '*' character is not supported for search.
    Hope it helps.
    If you need further assistance, please feel free to let me know.
    Best regards,
    Amy
    Amy Wang
    TechNet Community Support

  • How to insert special characters in pdf comments

    Now, we are ready to go "no paper" workflow, and so mark anything on pdf file, but we cannot insert most of special characters in PDF comments. Same as here, and the xml entity is "&PSgr;", "how to archive it?

    >what the Character Map is?
    You don't know how to use Google?
    Character map is a standard part of Windows for using special
    characters with any program.
    In Windows XP, Start > All Programs > Accessories > System Tools >
    Character Map.
    Aandi Inston

  • Special Characters issue in DEV and QAS

    Hi,
    I am uploading a file that has special characters (Japanese).
    In the DEV system the special character is converted to #. Which the business wants.
    In QAS system the special character is not converted and is as it is, which makes the business users difficult to find out if any speical characters are there and they don't want the special character as it is
    The file consists millions of record with a possibility of four or five records with special characters
    The special characters on keyboards is not an issue.
    The programs in DEV and QAS system are same and the file tested is also the same but different results.
    Tried in Tcode SNLS to find something but didn't know what and where to look into.
    What could be the issue in this? Looks like this is Basis issue but would like to know if anyone can let me know.......
    Regards
    Sandeep

    Hi ,
    i want to check ur open dataset statement in the program which is being used here if at all in ur case.
    Can you please check the relavant code page in both the D and Q systems and search with the appropriate hexa decimal values(for the special characters ) in both the systems ..
    u can use code page by tcode scp ..
    ex -> as u say a special char sp1 is having entry in q and code page which is being used (like 4200 )
    is not having in d03 .
    then if in d03 this page has no entry then it shows as # , since it is showing in q then it has an entry over there. this is my guess..
    so if at all the client wants not to see this special char's , u need to remove them from this code page.. and check ..
    Cant say if this can solve but u can take this as one more way of dealing with code pages  and special chars....
    br vijay..

Maybe you are looking for

  • Publishing in iWeb page With MONTH view being the default view

    Hi I'm using iWeb to publish a page, then editing the HTML code to include a non-scrolling frame that is my iCal calendar on it. It works ok EXCEPT that it defaults to a Week View on the web page, and that looks lame because for our purposes it shoul

  • Disable voice control

    How can I disable the voice control in my Iphone 3GS? Is really annoying and workless. thank you!

  • Advanced Web Gallery CS4

    I have recently upgraded from CS2. I have a handful of these galleries on the same site I created using CS2. I have modified them heavily from what CS2 would do. In reality I only used the Thumbnails, Images and the XML file that were created. Even t

  • IPhoto 5 & 6

    Hi, I am using iPhoto 5 on my first generation MacMini at Home. At the same time, I have a MacBookPro with iPhoto 6. My MacMini is attached to an external Harddisk which stores all my iPhoto & iTunes Database. Recently, I used my MacBook Pro to acces

  • Do we have PB VALUE and PB REFERENCE in RFC'SN or BAPI'S

    HI ABAPers, greetings to all, I HAVE A DOUBT REGARDING RFC'S concept. Do  we have PASS BY VALUE and PASS BY REFERENCE (OR) CALL BY VALUE and CALL BY REFERENCE in RFC'S or BAPI'S. IF SO HOW DO THEY WORK. please provide information about this PBR and P