Search Results

Search found 203 results on 9 pages for 'alphanumeric'.

Page 2/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • Allow alphanumeric, punctuation, and spaces

    - by bccarlso
    I'm pretty new to regular expressions, and MAN do they give me a headache. They are so intimidating! For an email campaign I'm doing, a user will click a link out of the email with a few URL parameters filled in for them, to make filling out a form easier. I want to prevent any injection hacks or whatever it's called, but need to allow the $_GET parameters to be alphanumeric, have punctuation, and have spaces. If someone has a good method for this, I'd appreciate it, but right now I have: foreach($_GET as $m=>$n) { $get[$m] = preg_replace('(^[a-z0-9 \-\_\.]+)i',' ',$n); } I would like to be able to replace all characters NOT found with this regular expression, which I believe I use ?!, but I can't get that to work either. Any help in getting this to work would be appreciated!

    Read the article

  • Auto Generate alphanumeric Unique Id with C#

    - by mag1981
    Hi All, total string length is 5 chars I have a scenario, ID starts with A0001 and ends with A9999 then B0001 to B9999 until F0001 to f9999 after that FA001 to FA999 then FB001 to FB999 until ....FFFF9 Please suggest any idea on how to create this format Thanks in advance

    Read the article

  • letters or numbers only in a password with jquery

    - by Greg
    Hi, I found this code for alphanumeric check ("Letters, numbers, spaces or underscores") but I want to change so I will be able to write only letters or numbers. Can anyone tell me how to change this code: function(value, element) { return this.optional(element) || /^\w+$/i.test(value);} Thanks! Greg

    Read the article

  • Removing non-alphanumeric characters in an Access Field.

    - by Jacques Tardie
    I need to remove hyphens from a string in a large number of access fields. What's the best way to go about doing this? Currently, the entries are follow this general format: 2010-54-1 2010-56-1 etc. I'm trying to run append queries off of this field, but I'm always getting validation errors causing the query to fail. I think the cause of this failure is the hypens in the entries, which is why I need to remove them. I've googled, and I see that there are a number of formatting guides using vbscript, but I'm not sure how I can integrate vb into Access. It's new to me :) Thanks in advance, Jacques

    Read the article

  • Short Python alphanumeric hash with minimal collisions

    - by ensnare
    I'd like to set non-integer primary keys for a table using some kind of hash function. md5() seems to be kind of long (32-characters). What are some alternative hash functions that perhaps use every letter in the alphabet as well as integers that are perhaps shorter in string length and have low collision rates? Thanks!

    Read the article

  • Removing characters from a alphanumeric field SQL

    - by LS
    Im moving data from one table to another using insert into. in the select bit need to transfer from column with characters and numerical in to another with only the numerical. The original column is in varchar format. original column - ABC100 XYZ:200 DD2000 Wanted column 100 200 2000 Cant write a function because cant have a function in side select statement when inserting

    Read the article

  • Using only alphanumeric characters(a-z) inside toCharArray

    - by Aaron
    Below you will find me using toCharArray in order to send a string to array. I then MOVE the value of the letter using a for statement... for(i = 0; i < letter.length; i++){ letter[i] += (shiftCode); System.out.print(letter[i]); } However, when I use shiftCode to move the value such as... a shifted by -1; I get a symbol @. Is there a way to send the string to shiftCode or tell shiftCode to ONLY use letters? I need it to see my text, like "aaron", and when I use the for statement iterate through a-z only and ignore all symbols and numbers. I THINK it is as simple as... letter=codeWord.toCharArray(a,z); But trying different forms of that and googling it didn't give me any results. Perhaps it has to do with regex or something? Below you will find a complete copy of my program; it works exactly how I want it to do; but it iterates through letters and symbols. I also tried finding instructions online for toCharArray but if there exists any arguments I can't locate them. My program... import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /* * Aaron L. Jones * CS219 * AaronJonesProg3 * * This program is designed to - * Work as a Ceasar Cipher */ /** * * Aaron Jones */ public class AaronJonesProg3 { static String codeWord; static int shiftCode; static int i; static char[] letter; /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { // Instantiating that Buffer Class // We are going to use this to read data from the user; in buffer // For performance related reasons BufferedReader reader; // Building the reader variable here // Just a basic input buffer (Holds things for us) reader = new BufferedReader(new InputStreamReader(System.in)); // Java speaks to us here / We get it to query our user System.out.print("Please enter text to encrypt: "); // Try to get their input here try { // Get their codeword using the reader codeWord = reader.readLine(); // Make that input upper case codeWord = codeWord.toUpperCase(); // Cut the white space out codeWord = codeWord.replaceAll("\\s",""); // Make it all a character array letter = codeWord.toCharArray(); } // If they messed up the input we let them know here and end the prog. catch(Throwable t) { System.out.println(t.toString()); System.out.println("You broke it. But you impressed me because" + "I don't know how you did it!"); } // Java Speaks / Lets get their desired shift value System.out.print("Please enter the shift value: "); // Try for their input try { // We get their number here shiftCode = Integer.parseInt(reader.readLine()); } // Again; if the user broke it. We let them know. catch(java.lang.NumberFormatException ioe) { System.out.println(ioe.toString()); System.out.println("How did you break this? Use a number next time!"); } for(i = 0; i < letter.length; i++){ letter[i] += (shiftCode); System.out.print(letter[i]); } System.out.println(); /**************************************************************** **************************************************************** ***************************************************************/ // Java speaks to us here / We get it to query our user System.out.print("Please enter text to decrypt: "); // Try to get their input here try { // Get their codeword using the reader codeWord = reader.readLine(); // Make that input upper case codeWord = codeWord.toUpperCase(); // Cut the white space out codeWord = codeWord.replaceAll("\\s",""); // Make it all a character array letter = codeWord.toCharArray(); } // If they messed up the input we let them know here and end the prog. catch(Throwable t) { System.out.println(t.toString()); System.out.println("You broke it. But you impressed me because" + "I don't know how you did it!"); } // Java Speaks / Lets get their desired shift value System.out.print("Please enter the shift value: "); // Try for their input try { // We get their number here shiftCode = Integer.parseInt(reader.readLine()); } // Again; if the user broke it. We let them know. catch(java.lang.NumberFormatException ioe) { System.out.println(ioe.toString()); System.out.println("How did you break this? Use a number next time!"); } for(i = 0; i < letter.length; i++){ letter[i] += (shiftCode); System.out.print(letter[i]); } System.out.println(); } }

    Read the article

  • Select fields containing at least one non-space alphanumeric character

    - by zzapper
    (Sorry I know this is an old chestnut; I have found similar answers here but not an exact answer) These are frequent hand written queries from a console so I is what I am looking for is the easiest thing to type SELECT * FROM tbl_loyalty_card WHERE CUSTOMER_ID REGEXP "[0-9A-Z]"; or SELECT * FROM tbl_loyalty_card WHERE LENGTH(CUSTOMER_ID) >0; -- could match spaces Do you have anything quicker to type even if it's QAD?

    Read the article

  • Remove leading zero's from alphanumeic text

    - by cedar715
    I've seen questions to prefix zeros here in SO. But not the other way !! Can you guys suggest me how to remove the leading zeros in alphanumeric text. Are there any built-in APIs or do I need to write a method to trim the leading zero's? Example: 01234 converts to 1234 0001234a converts to 1234a 001234-a converts to 1234-a 101234 remains as 101234 2509398 remains as 2509398 123z remains as 123z 000002829839 converts to 2829839

    Read the article

  • Sort MySQL query result by a alphanumeric field

    - by Jason Shultz
    I'm querying a table in a db using php. one of the fields is a column called "rank" and has data like the following: none 1-bronze 2-silver 3-gold ... 10-ambassador 11-president I want to be able to sort the results based on that "rank" column. any results where the field is "none" get excluded, so those don't factor in. As you can already guess, right now the results are coming back like this: 1-bronze 10-ambassador 11-president 2-silver 3-gold Of course, I would like for it to be sorted so it is like the following: 1-bronze 2-silver 3-gold ... 10-ambassador 11-president Right now the query is being returned as an object. I've tried different sort options like natsort, sort, array_multisort but haven't got it to work the way I'm sure it can. I would prefer keeping the results in an object form if possible. I'm passing the data on to a view in the next step. although, it's perfectly acceptable to pass the object to the view and then do the work there. so it's not an issue after all. :) thank you for your help. i'm hoping I'm making sense.

    Read the article

  • REGEX rejecting simple alphamumeric

    - by GDB
    I don't get it; this should be simple: Why does this text box entry: Foo 2010 Validated by this REGEX: ValidationExpression="^[a-zA-Z0-9 -_!]+$" Throw an invalid entry error? It is intended to allow alphamumerics, spaces, dashes, underscores and exclamation marks. REGEX gives me a headache ...

    Read the article

  • XSLT Sort Alphabetically & Numerically Problem

    - by Bryan
    I have a group of strings ie g:lines = '9,1,306,LUCY,G,89' I need the output to be: 1,9,89,306,G,LUCY This is my current code: <xsl:for-each select="$all_alerts[g:problem!='normal_service'][g:service='bus']"> <xsl:sort select="g:line"/> <xsl:sort select="number(g:line)" data-type="number"/> <xsl:value-of select="normalize-space(g:line)" /><xsl:text/> <xsl:if test="position()!=last()"><xsl:text>,&#160;</xsl:text></xsl:if> </xsl:for-each> I can get it to only display '1, 12, 306, 38, 9, G, LUCY' because the 2nd sort isn't being picked up. Anyone able help me out?

    Read the article

  • Java - Unknown characters passing as [a-zA-z0-9]*?

    - by Twodordan
    Hello, I'm no expert in regex but I need to parse some input I have no control over, and make sure I filter away any strings that don't have A-z and/or 0-9. When I run this, Pattern p = Pattern.compile("^[a-zA-Z0-9]*$"); //fixed typo if(!p.matcher(gottenData).matches()) System.out.println(someData); //someData contains gottenData certain spaces + an unknown symbol somehow slip through the filter (gottenData is the red rectangle): In case you're wondering, it DOES also display Text, it's not all like that. For now, I don't mind the [?] as long as it also contains some string along with it. Please help. [EDIT] as far as I can tell from the (very large) input, the [?]'s are either white spaces either nothing at all; maybe there's some sort of encoding issue, also perhaps something to do with #text nodes (input is xml)

    Read the article

  • How to search for alphanumeric word before or after a keyword in perl?

    - by aliocee
    I have sentences as shown in the below examples: $sen1 = "The quick brown fox jump KEYWORD over123 the3 lazy dog, fox is quick"; $sen2 = "The quick brown fox jump123 KEYWORD over the lazy dog, fox is quick"; i want to use the keyword 'KEYWORD' as my search string to extract the alphanumeric words before and after the search string using Perl regular expression. sample output: over123 jump123 NB: The word 'the3' is left out because i'm only searching for alphanumeric words exactly before or after the 'KEYWORD'. Thanks

    Read the article

  • MySQL PHP | "SELECT FROM table" using "alphanumeric"-UUID. Speed vs. Indexed Integer / Indexed Char

    - by dropson
    At the moment, I select rows from 'table01' using: SELECT * FROM table01 WHERE UUID = 'whatever'; The UUID column is a unique index. I know this isn't the fastest way to select data from the database, but the UUID is the only row-identifier that is available to the front-end. Since I have to select by UUID, and not ID, I need to know what of these two options I should go for, if say the table consists of 100'000 rows. What speed differences would I look at, and would the index for the UUID grow to large, and lag the DB? Get the ID before doing the "big" select 1. $id = "SELECT ID FROM table01 WHERE UUID = '{alphanumeric character}'"; 2. $rows = SELECT * FROM table01 WHERE ID = $id; Or keep it the way it is now, using the UUID. 1. SELECT FROM table01 WHERE UUID '{alphanumeric character}'; Side note: All new rows are created by checking if the system generated uniqueid exists before trying to insert a new row. Keeping the column always unique. The "example" table. CREATE TABLE Table01 ( ID int NOT NULL PRIMARY KEY, UUID char(15), name varchar(100), url varchar(255), `date` datetime ) ENGINE = InnoDB; CREATE UNIQUE INDEX UUID ON Table01 (UUID);

    Read the article

  • Problem to generate nested ul lists using PHP

    - by Michael Mao
    Hi all: I am working on a front-end web app where a nested unordered list would be used for the jQuery plugin mcdropdown. Here is the data structure from PHP: a nested array of arrays : Array ( [0] => Array ( [fullpath] => ../foil/alphanumeric/ [depth] => 0 ) [1] => Array ( [fullpath] => ../foil/alphanumeric/letters/ [depth] => 1 ) [2] => Array ( [fullpath] => ../foil/alphanumeric/numbers/ [depth] => 1 ) [3] => Array ( [fullpath] => ../foil/alphanumeric/numbers/symbols/ [depth] => 2 ) ) Basically, I took the excellent answer from this question on SO, modified it a bit : global $fullpaths; // $fullpaths contains the above data structure in print_r $result = ''; $currentDepth = -1; while(!empty($fullpaths)) { $currentNode = array_shift($fullpaths); if($currentNode['depth'] > $currentDepth) { $result .='<ul>'; } if($currentNode['depth'] < $currentDepth) { $result .=str_repeat('</ul>', $currentDepth - $currentNode['depth']); } $result .= '<li>'. $currentNode['fullpath'] .'</li>'; $currentDepth = $currentNode['depth']; if(empty($fullpaths)) { $result .= str_repeat('</ul>', 1 + $currentDepth); } } print $result; and got the following output: <ul> <li>../foil/alphanumeric/</li> <ul> <li>../foil/alphanumeric/letters/</li> <li>../foil/alphanumeric/numbers/</li> <ul> <li>../foil/alphanumeric/numbers/symbols/</li> </ul> </ul> </ul> Which cannot be accepted by the mcdropdown jQuery plugin, it expects something like this: <li rel="1"> 'Alphanumeric' <ul> <li rel="2">'Letters'</li> <li rel="3">'Numbers' <ul> <li rel="4">'Symbols'</li> </ul> </li> </ul> </li> To be frank, I don't quite understand how the answer from that question works, I have been trying to modify that solution to cope with my situation, but still failed. Any help and suggestion is much appropriated in advance.

    Read the article

  • Regex for Matching First Alphanumeric Character skipping (The |An? )

    - by TheLizardKing
    I have a list of artists, albums and tracks that I want to sort using the first letter of their respective name. The issue arrives when I want to ignore "The ", "A ", "An " and other various non-alphanumeric characters (Talking to you "Weird Al" Yankovic and [dialog]). Django has a nice start '^(An?|The) +' but I want to ignore those and a few others of my choice. I am doing this in Django, using a MySQL db with utf8_bin collation.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >