Search Results

Search found 4929 results on 198 pages for 'character'.

Page 117/198 | < Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >

  • Need Help in PHP Regex

    - by amateurs
    I am studying about regex, i figured out some about matching one or more character, but i have a case, but don't know how to solve this.. For example i have: $data = "bla bla -start- blu blu blu -end- bla bla"; $pattern = "/\-start\-[\w]\-end\- /"; preg_match($pattern, $data, $matches); print_r($matches); i intend to take anything between '-start-' and '-end-', so i expect to get ' blu blu blu '. any suggestion ?

    Read the article

  • Printing values of all fields in C++ structure

    - by Zhinkaas
    Say a simple structure struct abc { int a; char b; } I got some value in a variable defined as its structure and now I want to print below a = [some value] b = [some character] What is the best way to achieve this for an arbitrary structure without having to write a dump...(...) function for each of the structure I encounter?

    Read the article

  • Censoring selected words (replacing them with ****) using a single replaceAll?

    - by aioobe
    I'd like to censor some words in a string by replacing each character in the word with a "*". Basically I would want to do String s = "lorem ipsum dolor sit"; s = s.replaceAll("ipsum|sit", $0.length() number of *)); so that the resulting s equals "lorem ***** dolor ***". I know how to do this with repeated replaceAll invokations, but I'm wondering, is this possible to do with a single replaceAll?

    Read the article

  • Where does getopt_long store an unrecognized option?

    - by Rob Kennedy
    When getopt or getopt_long encounters an illegal option, it stores the offending option character in optopt. When the illegal option is a long option, where can I find out what the option was? And does anything meaningful get stored in optopt then? I've set opterr = 0 to suppress the automatically printed error message. I want to create my own message that I can print or log where I'd like, but I want to include the name of the unrecognized option.

    Read the article

  • pointer&dynamic memory

    - by gcc
    how many methods are there taking input by using with pointer and dynamic memory input 3 1 2 n k l 2 1 2 p 4 55 62 * # x x is stop character and first input 3 is for another variable int hakko; only hakko use first input the others will be hold in one pointer and input size not determined

    Read the article

  • Validate a string

    - by Activist
    I'm not that good with regular expressions... I need a JavaScript regular expression that will do the following: The string can contain letters (upper and lower case), but not punctuations such as éàïç... The string can contain numbers (0..9) anywhere in the string, except on the first position. The string can contain underscores (_). Valid strings: foo foo1 foo_bar fooBar Invalid strings: 1foo -- number as first character foo bar -- space föo -- punctuation ö Many thanks!

    Read the article

  • SQL Server varchar to datetime

    - by Dezigo
    I have a field varchar(14) = 20090226115644 I need convert it to - 2009-02-26 11:56:44 (datetime format) My idea. use cast and convert.. but I always have errors. Conversion failed when converting datetime from character string. I made this, but don`t like it.. SELECT SUBSTRING(move,1,4) + '-' + SUBSTRING(move,5,2) + '-' + SUBSTRING(move,7,2) + ' ' + SUBSTRING(move,9,2) + ':' + SUBSTRING(move,11,2) + ':'+SUBSTRING(move,13,2) as new -- FROM [Test].[dbo].[container_events] where move IS not null Result :2009-02-26 11:56:44

    Read the article

  • Why can't your switch statement data type be long Java?

    - by Fostah
    Here's an excerpt from Sun's Java tutorials: A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Classes and Inheritance) and a few special classes that "wrap" certain primitive types: Character, Byte, Short, and Integer (discussed in Simple Data Objects ). There must be a good reason why the long primitive data type is not allowed. Anyone know what it is?

    Read the article

  • Why does string::find return size_type and not an iterator?

    - by dehmann
    In C++, why does string::find return size_type and not an iterator? It would make sense because functions like string::replace or string::insert take iterators as input, so you could find some character and immediately pass the returned iterator to replace, etc. Also, std::find returns an iterator -- why is std::string::find different?

    Read the article

  • jQuery library to autopopulate multiple fields

    - by user1134179
    I have multiple textboxes with set character limits that together make up a code. There is value in the boxes being separated for a variety of reasons. I want to be able to paste a complete code in the first textbox and have it automatically populate all the textboxes. Is there a way to do this in javascript or a jquery library for this case? Currently I'm using jQuery autotab on each textbox and I'd prefer to keep that functionality.

    Read the article

  • Is there YAPE::Regex::Explain alternative to python?

    - by S.Mark
    Is there perl's YAPE::Regex::Explain alternative to python? Which could do \w+=\d+|\w+='[^']+' to explanations like this NODE EXPLANATION -------------------------------------------------------------------------------- \w+ word characters (a-z, A-Z, 0-9, _) (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- = '=' -------------------------------------------------------------------------------- \d+ digits (0-9) (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- | OR -------------------------------------------------------------------------------- \w+ word characters (a-z, A-Z, 0-9, _) (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- =' '=\'' -------------------------------------------------------------------------------- [^']+ any character except: ''' (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- ' '\''

    Read the article

  • Copying an entire table with Postgres

    - by NudeCanalTroll
    Hello, I'm trying to copy the contents of one table into another in Postgres, however it appears some rows aren't being copied correctly: ActiveRecord::StatementInvalid: PGError: ERROR: column "email_date" is of type timestamp without time zone but expression is of type character varying HINT: You will need to rewrite or cast the expression. Is there any way I can have it automatically skip (or ignore) invalid rows? Here's the query I'm using: SET statement_timeout = 0; INSERT INTO emails3 SELECT * FROM emails

    Read the article

  • Python : Convert from C-Char to Int

    - by cuband
    I have a string read in from a binary file that is unpacked using struct.unpack as a string of length n. Each byte in the string is a single integer (1-byte) representing 0-255. So for each character in the string I want to convert it to an integer. I can't figure out how to do this. Using ord doesn't seem to be on the right track...

    Read the article

  • Python - Find where in string regex match was found?

    - by nb
    I'm currently using regular expressions to search through RSS feeds to find if certain words and phrases are mentioned, and would then like to extract the text on either side of the match as well. For example: String = "This is an example sentence, it is for demonstration only" re.search("is", String) I'd like to know where the is was found so that I can extract and output something like this: 1 match found: "This is an example sentence" I know that it would be easy to do with splits, but I'd need to know what the index of first character of the match was in the string, which I don't know how to find

    Read the article

  • writing into a file in c.

    - by mekasperasky
    i have an char array b[20] which i want to write into a file . After every iteration the value of b[20] changes , so i would like to write the string in each line of the file in each iteration . So how can i change a new line in a file and also put in a array of character?

    Read the article

< Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >