Search Results

Search found 35302 results on 1413 pages for 'string literals'.

Page 150/1413 | < Previous Page | 146 147 148 149 150 151 152 153 154 155 156 157  | Next Page >

  • preg_match_all to parse an xml-like attribute string

    - by Rob
    I have a string like so: option_alpha="value" option_beta="some other value" option_gamma="X" ...etc. I'm using this to parse them into name & value pairs: preg_match_all("/([a-z0-9_]+)\s*=\s*[\"\'](.+?)[\"\']/is", $var_string, $matches) Which works fine, unless it encounters an empty attribute value: option_alpha="value" option_beta="" option_gamma="X" What have I done wrong in my regex?

    Read the article

  • Get string value from http response with Mechanize

    - by Gearóid
    Hi, I'm currently integrating facebook into my current app and I've succeeded in retrieving the access_token using the following code: url="#{url}?#{client_id}&#{client_secret}&#{code}&#{redirect_uri}&type=client_cred" agent = Mechanize.new page = agent.get(url) The page object above has a body which contains text something along the lines of access_token=XXXXX I just want to pull out the access_token value. I can get the entire string simply by writing: page.body But I was wondering is there a way to get the access_token value without resorting to regular expressions etc? Thanks.

    Read the article

  • Passing delimited string to stored procedure to search database

    - by rs
    How can i pass a string delimited by space or comma to stored procedure and filter result? I'm trying to do something like - Parameter Value -------------------------- @keywords key1 key2 key3 Then is stored procedure i want to first find all records with first or last name like key1 filter step 1 with first or last name like key2 filter step 2 with first or last name like key 3

    Read the article

  • Instantiate a model when the kind of model needed is represented as a string argument

    - by indiehacker
    My input data is a string representing the kind of datastore model I want to make. In python, I am using the eval() function to instantiate the model (below code), but this seems overly complex so I was wondering if there is a simpler way people normally do this? >>>model_kind="TextPixels" >>>key_name_eval="key_name" >>>key_name="key_name" >>>kwargs {'lat': [0, 1, 2, 3], 'stringText': 'boris,ted', 'lon': [0, 1, 2, 8], 'zooms': [0, 10]} >>>obj=eval( model_type + '(key_name='+tester+ ',**kwargs )' ) >>>obj <datamodel.TextPixels object at 0xed8808c>

    Read the article

  • php: regex remove bracket in string

    - by apis17
    hi, similiar like this example, http://stackoverflow.com/questions/1336672/php-remove-brackets-contents-from-a-string i have no idea to replace $str = '(ABC)some text' into $str = 'ABC'; currently use $str = preg_replace('/(.)/','',$str); but not works. how to fix this?

    Read the article

  • MySQL: fetching a null or an empty string

    - by Oden
    Hey, I know whats the difference between a NULL value and an empty string ("") value, but if I want to get a value by using the OR keyword, I get no result for a NULL value The table i want to query looks like this: titles_and_tags +----+----------+------+ | id | title | tag | +----+----------+------+ | 1 | title1 | NULL | | 2 | title2 | tag1 | | 3 | title3 | tag2 | +----+----------+------+ The query i use looks like this: select * from `titles_and_tags` WHERE `title` LIKE "title" AND `tag` = "tag1" OR `tag` IS NULL So i want to get here a rows (id: 1,2), BUT this results 0 rows. What have i done wrong?

    Read the article

  • PHP curly string syntax question

    - by zildjohn01
    I'm running PHP 5.3.0. I've found that the curly string syntax only works when the first character of the expression is $. Is there a way to include other types of expressions (function calls, etc)? Trivial example: <?php $x = '05'; echo "{$x}"; // works as expected echo "{intval($x)}"; // hoped for "5", got "{intval(05)}"

    Read the article

  • LINQ expression until to break a string

    - by wonea
    Using LINQ I'm looking to break down the following path string[], however I'd like to break it up to the point of the Binn folder. Is there a WHERE UNTIL operator in LINQ? c:\ Program Files\ Microsoft SQL Server\ MSSQL10.SQLEXPRESS\ MSSQL\ Binn\ sqlservr.exe What I'd like todo var words = from word in thepath where UNTIL thepath == "Binn" select word;

    Read the article

  • how to generate String difference vectors?

    - by SWKK
    Hi Guys, a bit of a vague question but I am looking for pointers as to how can I generate String diff vectors in C++. The scenario is such that given a paragraph I want to store the various differences(Edit, cut copy paste etc.) it goes through in a draft mode to review Audit history. Any hints in this regard will be really appreciated.

    Read the article

  • Django | capture sub domain as a string

    - by MMRUser
    How do I capture a part of sub-domain name and get that name as a string in my views through a request. ex: user.domain.com developer.domain.com I want to capture the user part of this domain name through a request (lets say when the first time user hits the page). Thanks.

    Read the article

  • find substrings inside string

    - by senzacionale
    How can i find substrings inside string and then remember and delete it when i found it. EXAMPLE: select * from (select a.iid_organizacijske_enote, a.sifra_organizacijske_enote "Sifra OE", a.naziv_organizacijske_enote "Naziv OE", a.tip_organizacijske_enote "Tip OE" I would like to get all word inside " ", so Sifra OE Naziv OE TIP OE and return select * from (select a.iid_organizacijske_enote, a.sifra_organizacijske_enote, a.naziv_organizacijske_enote, a.tip_organizacijske_enote i try with regex, indexOf() but no one works ok

    Read the article

  • Encode and Decode a string in c#

    - by Jibu P C
    Hii, I had a requirement of encode a string provided to a unreadable format and also have to decode after certain action performed. I have tried 'Base64' encoding. But this is not a secure way. I need some other solutions. Give some help regarding the above context.

    Read the article

  • Using RegEx to Identify parts of a Database Connection String

    - by David_Jarrett
    I'm trying to get to grips with regular expressions: I have a database connection string and I'd like to use a regular expression to identify specific Keys and Values within it. For example server=foo;database=bar;uid=foo;pwd=bar I'd like something to return "database=bar;" using the 'database' key to identify it, ideally it would be case insensitive. I can do this using normal code, but I think that this is exactly the sort of thing for which regular expressions were designed.

    Read the article

  • [genshi] Print string as HTML

    - by infinito
    Hello, I would like to know if is there any way to convert a plain unicode string to HTML in Genshi, so, for example, it renders newlines as <br/>. I want this to render some text entered in a textarea. Thanks in advance!

    Read the article

  • C# Get Keys from a Dictionary<string, Stream>

    - by alex
    Suppose I have a Dictionary like so: Dictionary<string, Stream> How can I get a list (or IEnumerable or whatever) of JUST the Keys from this dictionary? Is this possible? I could enumerate the dictionary, and extract the keys one by one, but I was hoping to avoid this. In my instance, the Dictionary contains a list of filenames (file1.doc, filex.bmp etc...) and the stream content of the file from another part of the application.

    Read the article

< Previous Page | 146 147 148 149 150 151 152 153 154 155 156 157  | Next Page >