Sponsored Content
Top Forums Shell Programming and Scripting Regular expression (regex) required Post 302384707 by shams11 on Wednesday 6th of January 2010 06:11:28 AM
Old 01-06-2010
MySQL

@anchal

in first name field I want to block multiple dots
ex:

FirstName should not be => . (dot)or .......(multiple dots)

it can be => a.b.c.

am using => split( [^a-zA-Z0-9.] )


But it does not workSmilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regular Expression + Aritmetical Expression

Is it possible to combine a regular expression with a aritmetical expression? For example, taking a 8-numbers caracter sequece and casting each output of a grep, comparing to a constant. THX! (2 Replies)
Discussion started by: Z0mby
2 Replies

2. Linux

Regular expression to extract "y" from "abc/x.y.z" .... i need regular expression

Regular expression to extract "y" from "abc/x.y.z" (2 Replies)
Discussion started by: rag84dec
2 Replies

3. UNIX for Advanced & Expert Users

Regular expression / regex substition on Unicode text

I have a large file encoded in Unicode that I need to convert to CSV. In general, I know how to do this by regular expression substitutions using sed or Perl, but one problem I am having is that I need to put a quotation mark at the end of each line to protect the last field. The usual regex... (1 Reply)
Discussion started by: thomas.hedden
1 Replies

4. Shell Programming and Scripting

Integer expression expected: with regular expression

CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error. source $CA_VERSION_DATA if * ] then echo "CA_RELESE $CA_RELEASE is invalid" exit -1 fi + source /etc/ncgl/ca_version_data ++ CA_PRODUCT_ID=samxts ++ CA_RELEASE=6 ++ CA_WEEK_NO=7 ++... (3 Replies)
Discussion started by: ketkee1985
3 Replies

5. Shell Programming and Scripting

Required help in perl regular expression substitution for this date format

Hi, I have written a small perl script to handle particular date format using perl, but it is not substituting the whole string. Can some one please check on what is the issue with the code. $_ = "Date: November 25, 2010 09:02:01 PM";... (1 Reply)
Discussion started by: sarbjit
1 Replies

6. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

Hi all, How am I read a file, find the match regular expression and overwrite to the same files. open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat"; open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat"; while (<DESTINATION_FILE>) { # print... (1 Reply)
Discussion started by: jessy83
1 Replies

7. Shell Programming and Scripting

passing a regex as variable to awk and using that as regular expression for search

Hi All, I have a sftp session log where I am transferring multi files by issuing "mput abc*.dat". The contents of the logfile is below - ################################################# Connecting to 10.75.112.194... Changing to: /home/dasd9x/testing1 sftp> mput abc*.dat Uploading... (7 Replies)
Discussion started by: k_bijitesh
7 Replies

8. Emergency UNIX and Linux Support

Regular expression (regex) clean up text

Hi, Server - MEDIAWIKI - MYSQL - CENTOS 5 - PHP5 I have a database import of close to a million pages into my wiki, mediawiki site, the format that were left with is not pretty, and I need to find a way to clean this up and present it nicely... I think regex is the best option as I can... (1 Reply)
Discussion started by: lawstudent
1 Replies

9. UNIX for Advanced & Expert Users

sed: -e expression #1, char 0: no previous regular expression

Hello All, I'm trying to extract the lines between two consecutive elements of an array from a file. My array looks like: problem_arr=(PRS111 PRS213 PRS234) j=0 while } ] do k=`expr $j + 1` sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt ---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies

10. Shell Programming and Scripting

Help required in writing the regular expression.

1 1982 1 testing init.cc 3001 Apr 25 2014 09:56:13.617 Task(0x5bac5060) tRestart (stack st:0x5bace000, end:0x5bac8000) deleted 1 1982 1 testing init.cc 3001 Apr 25 2014 09:56:13.628 Task(0x5bac5060) tRestart (stack st:... (12 Replies)
Discussion started by: VSSajjan
12 Replies
Writing on the braille display(3)				      BrlAPI					 Writing on the braille display(3)

NAME
Writing on the braille display - Write text to the braille display. Data Structures struct brlapi_writeArguments_t Macros #define BRLAPI_DISPLAY_DEFAULT -1 #define BRLAPI_CURSOR_LEAVE -1 #define BRLAPI_CURSOR_OFF 0 #define BRLAPI_WRITEARGUMENTS_INITIALIZER { BRLAPI_DISPLAY_DEFAULT, 0, 0, NULL, -1, NULL, NULL, BRLAPI_CURSOR_LEAVE, NULL } Functions int BRLAPI_STDCALL brlapi_writeText (int cursor, const char *text) int BRLAPI_STDCALL brlapi__writeText (brlapi_handle_t *handle, int cursor, const char *text) int BRLAPI_STDCALL brlapi_writeDots (const unsigned char *dots) int BRLAPI_STDCALL brlapi__writeDots (brlapi_handle_t *handle, const unsigned char *dots) int BRLAPI_STDCALL brlapi_write (const brlapi_writeArguments_t *arguments) int BRLAPI_STDCALL brlapi__write (brlapi_handle_t *handle, const brlapi_writeArguments_t *arguments) Detailed Description After brlapi_enterTtyMode() has been called, the application can call one of these functions to write things on the braille display. Note: Be sure to call brlapi_enterTtyMode() before calling brlapi_write(), or else you'll get an error. This is particularly not always trivial when writing multithreaded applications. Dots are coded as described in ISO/TR 11548-1: a dot pattern is coded by a byte in which bit 0 is set iff dot 1 is up, bit 1 is set iff dot 2 is up, ... bit 7 is set iff dot 8 is up. This also corresponds to the low-order byte of the coding of unicode's braille row U+2800. Text is translated by the server one to one, by just using a simple wchar_t to pattern table, i.e. no contraction/expansion is performed, because the client would then have no way to know how wide the output would be and thus the quantity of text to feed. If contraction/expansion is desired, the client should perform it itself (e.g. thanks to liblouis or gnome-braille) and send the resulting dot patterns. This is actually exactly the same problem as font rendering on a graphical display: for better control, nowadays all font rasterization is performed on the client side, and mere pixmaps are sent to the X server. Macro Definition Documentation #define BRLAPI_CURSOR_LEAVE -1 Do not change the cursor's state or position. See Also: brlapi_writeText() brlapi_write() brlapi_writeArguments_t #define BRLAPI_CURSOR_OFF 0 Do not display the cursor. See Also: brlapi_writeText() brlapi_write() brlapi_writeArguments_t #define BRLAPI_DISPLAY_DEFAULT -1 Write to the default display on the braille device. See Also: brlapi_write() brlapi_writeArguments_t #define BRLAPI_WRITEARGUMENTS_INITIALIZER { BRLAPI_DISPLAY_DEFAULT, 0, 0, NULL, -1, NULL, NULL, BRLAPI_CURSOR_LEAVE, NULL } Allows to initialize a structure of type brlapi_writeArguments_t * with default values: displayNumber = BRLAPI_DISPLAY_DEFAULT; (unspecified) regionBegin = regionSize = 0; (update the whole display, DEPRECATED and will be forbidden in next release. You must always express the region you wish to update) text = andMask = orMask = NULL; (no text, no attribute) cursor = BRLAPI_CURSOR_LEAVE; (don't touch cursor) Function Documentation int BRLAPI_STDCALL brlapi__write (brlapi_handle_t *handle, const brlapi_writeArguments_t *arguments) int BRLAPI_STDCALL brlapi__writeDots (brlapi_handle_t *handle, const unsigned char *dots) int BRLAPI_STDCALL brlapi__writeText (brlapi_handle_t *handle, intcursor, const char *text) int BRLAPI_STDCALL brlapi_write (const brlapi_writeArguments_t *arguments) Update a specific region of the braille display and apply and/or masks Parameters: arguments gives information necessary for the update regionBegin and regionSize must be filled for specifying which part of the display will be updated, as well as the size (in characters, not bytes) of the text, andMask and orMask members. If given, the 'text' field holds the text that will be displayed in the region. The char string must hold exactly as many characters as the region fields express. For multibyte text, this is the number of multibyte caracters. Notably, combining and double-width caracters count for 1. The actual length of the text in bytes may be specified thanks to textSize. If -1 is given, it will be computed thanks to strlen(), so 'text' must then be a NUL-terminated string. The 'andMask' and 'orMask' masks, if present, are then applied on top of the text, one byte per character. This hence permits the superimposing of attributes over the text. For instance, setting an andMask mask full of BRLAPI_DOTS(1,1,1,1,1,1,0,0) will only keep (logical AND) dots 1-6, hence dropping dots 7 and 8. On the contrary, setting an orMask full of BRLAPI_DOT7|BRLAPI_DOT8 will add (logical OR) dots 7 and 8. The 'charset' field, if present, specifies the charset of the 'text' field. If it is '', the current locale's charset (if any) is assumed. Else, the 8-bit charset of the server is assumed. A special invocation is with an unmodified initialized structure: this clears the client's whole display, letting the display of other applications on the same tty or of applications 'under' the tty appear. See Concurrency management section of the BrlAPI documentation for more details. Returns: 0 on success, -1 on error. int BRLAPI_STDCALL brlapi_writeDots (const unsigned char *dots) Write the given dots array to the display Parameters: dots points on an array of dot information, one per character. Its size must hence be the same as what brlapi_getDisplaySize() returns. Returns: 0 on success, -1 on error. int BRLAPI_STDCALL brlapi_writeText (intcursor, const char *text) Write the given -terminated string to the braille display If the string is too long, it is truncated. If it's too short, it is padded with spaces. The text is assumed to be in the current locale charset, or latin1 if locales have not been initialized. To initialize locales, use setlocale(3). Parameters: cursor gives the cursor position; if equal to BRLAPI_CURSOR_OFF, no cursor is shown at all; if cursor==BRLAPI_CURSOR_LEAVE, the cursor is left where it is text points to the string to be displayed. Returns: 0 on success, -1 on error. Author Generated automatically by Doxygen for BrlAPI from the source code. Version 1.0 Fri Jun 7 2013 Writing on the braille display(3)
All times are GMT -4. The time now is 03:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy