[PHP] ereg et all
hi, is there a simple way to replace an occurence of a string, into another, maintaing capital positions... Like: $str = This equals this equals tHis; and I wanna replace all occurences of this in that, that the result will be: $str = That equals that equals That; Edward -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] ereg et all
try: eregi_replace(this,that,This equals this equals tHis); -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:40 PM To: [EMAIL PROTECTED] Subject: [PHP] ereg et all hi, is there a simple way to replace an occurence of a string, into another, maintaing capital positions... Like: $str = This equals this equals tHis; and I wanna replace all occurences of this in that, that the result will be: $str = That equals that equals That; Edward -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all
that is not what I meant... I want the cases to remain... - Original Message - From: Rick Emery [EMAIL PROTECTED] To: 'Edward van Bilderbeek - Bean IT' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:47 PM Subject: RE: [PHP] ereg et all try: eregi_replace(this,that,This equals this equals tHis); -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:40 PM To: [EMAIL PROTECTED] Subject: [PHP] ereg et all hi, is there a simple way to replace an occurence of a string, into another, maintaing capital positions... Like: $str = This equals this equals tHis; and I wanna replace all occurences of this in that, that the result will be: $str = That equals that equals That; Edward -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all
I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff At 10:52 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: that is not what I meant... I want the cases to remain... - Original Message - From: Rick Emery [EMAIL PROTECTED] To: 'Edward van Bilderbeek - Bean IT' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:47 PM Subject: RE: [PHP] ereg et all try: eregi_replace(this,that,This equals this equals tHis); -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:40 PM To: [EMAIL PROTECTED] Subject: [PHP] ereg et all hi, is there a simple way to replace an occurence of a string, into another, maintaing capital positions... Like: $str = This equals this equals tHis; and I wanna replace all occurences of this in that, that the result will be: $str = That equals that equals That; Edward -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all
Oh, that was a typo... sorry... it should be: This equals this equals tHis - That equals that equals tHat Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:56 PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff At 10:52 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: that is not what I meant... I want the cases to remain... - Original Message - From: Rick Emery [EMAIL PROTECTED] To: 'Edward van Bilderbeek - Bean IT' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:47 PM Subject: RE: [PHP] ereg et all try: eregi_replace(this,that,This equals this equals tHis); -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 3:40 PM To: [EMAIL PROTECTED] Subject: [PHP] ereg et all hi, is there a simple way to replace an occurence of a string, into another, maintaing capital positions... Like: $str = This equals this equals tHis; and I wanna replace all occurences of this in that, that the result will be: $str = That equals that equals That; Edward -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all
Ahhh, ok makes more sense now. Although, I don't think that there is an easy way to do what you are asking. I think that in order to accomplish that, you will have to specify all possible cases of a string, and have a ereg_replace() statement for each of them. Jeff At 11:01 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: Oh, that was a typo... sorry... it should be: This equals this equals tHis - That equals that equals tHat Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:56 PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all
hmm, that's not what i wanted to hear :-))) e.g. try doing that for the word: transparancy looots of different possibilities then... Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now. Although, I don't think that there is an easy way to do what you are asking. I think that in order to accomplish that, you will have to specify all possible cases of a string, and have a ereg_replace() statement for each of them. Jeff At 11:01 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: Oh, that was a typo... sorry... it should be: This equals this equals tHis - That equals that equals tHat Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:56 PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all - new question..
Maybe I better ask my question different... what i want to do is, to highlight certain text in a string... for example: This equals this equals tHis... has to become: bThis/b equals bthis/b equals btHis/b... so dispite the case, the b's should be put around it... does that make it easier? not for me :-) Greets, Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now. Although, I don't think that there is an easy way to do what you are asking. I think that in order to accomplish that, you will have to specify all possible cases of a string, and have a ereg_replace() statement for each of them. Jeff At 11:01 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: Oh, that was a typo... sorry... it should be: This equals this equals tHis - That equals that equals tHat Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:56 PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all - new question..
Seems like that makes it a LOT easier. Use eregi_relace() instead of ereg_replace(). eregi allows for case-insensitivity. Try eregi_replace(this,b\\1/b,$str); That should do it, though I haven't tried it myself. On Thu, 2002-01-31 at 14:14, Edward van Bilderbeek - Bean IT wrote: Maybe I better ask my question different... what i want to do is, to highlight certain text in a string... for example: This equals this equals tHis... has to become: bThis/b equals bthis/b equals btHis/b... so dispite the case, the b's should be put around it... does that make it easier? not for me :-) Greets, Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now. Although, I don't think that there is an easy way to do what you are asking. I think that in order to accomplish that, you will have to specify all possible cases of a string, and have a ereg_replace() statement for each of them. Jeff At 11:01 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: Oh, that was a typo... sorry... it should be: This equals this equals tHis - That equals that equals tHat Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:56 PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all - new question..
Sorry, that should be: eregi_replace((this),b\\1/b,$str); On Thu, 2002-01-31 at 14:20, Richard Crawford wrote: Seems like that makes it a LOT easier. Use eregi_relace() instead of ereg_replace(). eregi allows for case-insensitivity. Try eregi_replace(this,b\\1/b,$str); That should do it, though I haven't tried it myself. On Thu, 2002-01-31 at 14:14, Edward van Bilderbeek - Bean IT wrote: Maybe I better ask my question different... what i want to do is, to highlight certain text in a string... for example: This equals this equals tHis... has to become: bThis/b equals bthis/b equals btHis/b... so dispite the case, the b's should be put around it... does that make it easier? not for me :-) Greets, Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now. Although, I don't think that there is an easy way to do what you are asking. I think that in order to accomplish that, you will have to specify all possible cases of a string, and have a ereg_replace() statement for each of them. Jeff At 11:01 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: Oh, that was a typo... sorry... it should be: This equals this equals tHis - That equals that equals tHat Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:56 PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all - new question..
Wow, thanks a lot... although it should be \\0 here... didn't see anything in the manual about the \\ maybe gotta look for it again :-) Thanks, Edward - Original Message - From: Richard Crawford [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:20 PM Subject: Re: [PHP] ereg et all - new question.. Seems like that makes it a LOT easier. Use eregi_relace() instead of ereg_replace(). eregi allows for case-insensitivity. Try eregi_replace(this,b\\1/b,$str); That should do it, though I haven't tried it myself. On Thu, 2002-01-31 at 14:14, Edward van Bilderbeek - Bean IT wrote: Maybe I better ask my question different... what i want to do is, to highlight certain text in a string... for example: This equals this equals tHis... has to become: bThis/b equals bthis/b equals btHis/b... so dispite the case, the b's should be put around it... does that make it easier? not for me :-) Greets, Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now. Although, I don't think that there is an easy way to do what you are asking. I think that in order to accomplish that, you will have to specify all possible cases of a string, and have a ereg_replace() statement for each of them. Jeff At 11:01 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: Oh, that was a typo... sorry... it should be: This equals this equals tHis - That equals that equals tHat Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:56 PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg et all - new question..
\\1, actually. \\0 refers to the entire source string, not just to the part inside the parentheses... so I think it would put the bold tags around the entire contents of $str, not just the this words. At least, that's according to the source I'm using (_Professional PHP Programming_ by Castagnetto, et al). YMMV, so you may wish to try it both ways. On Thu, 2002-01-31 at 14:23, Edward van Bilderbeek - Bean IT wrote: Wow, thanks a lot... although it should be \\0 here... didn't see anything in the manual about the \\ maybe gotta look for it again :-) Thanks, Edward - Original Message - From: Richard Crawford [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:20 PM Subject: Re: [PHP] ereg et all - new question.. Seems like that makes it a LOT easier. Use eregi_relace() instead of ereg_replace(). eregi allows for case-insensitivity. Try eregi_replace(this,b\\1/b,$str); That should do it, though I haven't tried it myself. On Thu, 2002-01-31 at 14:14, Edward van Bilderbeek - Bean IT wrote: Maybe I better ask my question different... what i want to do is, to highlight certain text in a string... for example: This equals this equals tHis... has to become: bThis/b equals bthis/b equals btHis/b... so dispite the case, the b's should be put around it... does that make it easier? not for me :-) Greets, Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 11:06 PM Subject: Re: [PHP] ereg et all Ahhh, ok makes more sense now. Although, I don't think that there is an easy way to do what you are asking. I think that in order to accomplish that, you will have to specify all possible cases of a string, and have a ereg_replace() statement for each of them. Jeff At 11:01 PM 1/31/2002 +0100, Edward van Bilderbeek - Bean IT wrote: Oh, that was a typo... sorry... it should be: This equals this equals tHis - That equals that equals tHat Edward - Original Message - From: Jeff Sheltren [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:56 PM Subject: Re: [PHP] ereg et all I'm not sure why you wanted the last word tHis to be changed to That (with a capital)... can you explain further? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]