Omgili - forum search, search forums  
  

Discussions about replace

Displaying 1 - 10 out of 1,163,063 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
I’m selecting data on an old database which has an abused status column. The status column has multiple pieces of information in it. Values are like ‘New Contact YYYY’, ‘Online YYYY’, ‘Updated YYYY’, ‘Withdrawn YYYY’, etc…. As you may have guessed, YYYY...
Started by on , 4 posts by 4 people.  
If you simply want to extract a four digit year from the string, you could use PATINDEX SELECT SUBSTRING(FieldName, PATINDEX('%[0-9][0-9][0-9][0-9]%', FieldName), 4) FROM TableName If the year allways are the last 4: SELECT right(FieldName,4) from table... .
Can anyone help me decode why this doesnt work? $cssid = preg_replace("/'/", "", $cssid); Trying to strip the single quote marks from some html... Thanks! H EDIT This is the full function - it's designed to rebuild the Drupal menu using images, and it...
Started by on , 6 posts by 6 people.  
If str_replace("'","") doesn't work And for the apostrophe replacement....
But why don’t you use str_replace as you’re replacing a fixed string? $cssid = str_replace("'", "", $cssid); escape the single quote.
Your code looks fine.
Hello again. $string = preg_replace("#\[name=([a-zA-Z0-9 .-]+)*]#",'<td><a href="' . "$front_page/" . str_replace(' ', '-', "$1") . '">'."$1</a></td>",$string); This part of script doesn't work: str_replace(' ', '-', "$1") I need...
Started by on , 3 posts by 3 people.  
But you can do so by either using the e modifier in your regular expression : $string = preg_replace("#\[name=([a-zA-Z0-9 .-]+)*]#e", '"<td><a href=\"$front_page....
The replacement is evaluated upfront and not on each replace.
Ask your Facebook Friends
Just migrating from PHP 5.2 to 5.3, lot of hard work! Is the following ok, or would you do something differently? $cleanstring = ereg_replace("[^A-Za-z0-9]^[,]^[.]^[_]^[:]", "", $critvalue); to $cleanstring = preg_replace("[^A-Za-z0-9]^[,]^[.]^[_]^[:]...
Started by on , 3 posts by 3 people.  
Your regular expression; An example: $out = preg_replace('![^0-9a-zA-Z]+!', '', $in); Note I'm using criteria the following should do what you want: $cleanstring = preg_replace('#[^a-zA-Z0-9.
I came to know PHP after Perl, so when I first found preg_* function I basically just used those. Later I read that str_replace() is faster when dealing with literal text. So my question is, can't preg_replace() be as efficient as str_replace() when the...
Started by on , 9 posts by 9 people.  
It is possible the PHP team could jigger preg....
Joe In theory yes, you're right.
Although trying to do the same in preg with str_replace, is actually slower if you're doing complicated stuff.
Use preg otherwise attempt with str_replace.
I want to do find and replace for example . In dreamweaver's find and replace <p><strong>Business Development</strong></p> into <h4>Business Development</h4> I have to change in lots of files. I'm trying this But it...
Started by on , 4 posts by 4 people.  
This may help....
Simply change the Search field to Source Code and then it should be able to do it easily if you type your two statements in .
I saw the answer on your Stack Overflow question, however, I do this sort of thing all the time in Dreamweaver .
I have some text, something like this: Paragraphs of text (SOME KNOWN TEXT)Unknown Text(SOME OTHER KNOWN TEXT) Some additional paragraphs of text What I want is to keep the Unknown Text , but get rid of the ( SOME KNOWN TEXT) and (SOME OTHER KNOWN TEXT...
Started by on , 4 posts by 4 people.  
The first argument is the set of keys to replace, the second argument is what to replace....
If the two texts truly are known, you can do this: $result = str_replace(array('(SOME KNOWN TEXT is better performance than a regular expression.
Okay, here's what I'm trying to do: I'm trying to use PHP to develop what's essentially a tiny subset of a markdown implementation, not worth using a full markdown class. I need essentially do a str_replace, but alternate the replace string for every ...
Started by on , 3 posts by 3 people.  
Personally, I'd loop through each occurrence of * or \ with a counter, and replace the character an asterisk, replace it with <em> , if it's odd then replace it with </em> , etc_replace('/\*([^*]+)\*/', '<em&....
Hello, If have a following element in my XSL file: <xsl:value-of select="replace(lower-case(@name), '_([a-z0-9])', '$1')" /> For example from 'get_polygene_lubricants' it makes 'getpolygenelubricants'. What I want to do is to replace the first letter...
Started by on , 3 posts by 3 people.  
The replace() function supposes that you have.
As required: underLinedString Below is the old solution.
I need to replace multiple instances of a certain string (question mark) with strings from an array. e.g. if the string I wish to replace appears 3 times and my array has a length of 3, the first one would be replaced by the first item in the array, the...
Started by on , 3 posts by 3 people.  
Preg_replace_callback can cater for a far wider range of circumstances..
Use preg_replace_callback() : preg_replace always control the input string.
Information between callbacks but it's very flexible otherwise.
Page: 1   2   3   4   5   6   7   8   9   10  

Related Message Boards & Forums

  • Stack Overflow
  • Super User
Related Searches
The Replacements    replacing null    the replacements hentai    python replace    FZ50 replacement    5K100 replacement    sylink replacer    dos replace    replace VC    key replace   
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost