[Vienna-pm] Ersetzen eines Chars in einem String

Klaus Zahradnik klaus at kwz.at
Sat Feb 28 07:33:00 CST 2004


On Sat, Feb 28, 2004 at 02:13:12PM +0100, Christian Schoeller wrote:
> On Sat, Feb 28, 2004 at 02:02:02PM +0100, Klaus Zahradnik wrote:
> > In php habe ich dafür die Funktion ereg_replace(); Gibt es sowas auch in
> > Perl?
> 
> Ja, moeglich mit dem Ersetzungsoperator s///. Grundsaetzlich arbeitet
> er gleich wie m// mit RegExps, die Aenderung ist jedoch, dass nach dem 
> zweiten Slash der neue Ausdruck folgen muss.


Danke!
kwz


> 
> Beispiel: "I like Perl." 
> s/like/love/ gibt den Satz veraendert zurueck: "I love Perl."
> 
> 	C.
> 
> -- 
> Christian Schoeller {Student}  | "If there is anything more important
> MAIL {mailto:c_p_s at gmx.net}    | than my ego around, I want it caught
> HTTP {http://www.yaup.at.tt}   | and shot now."
> EBAY {c_p_s!}                  | -A Hitchhiker's Guide to the Galaxys


> _______________________________________________
> Vienna-pm mailing list
> Vienna-pm at mail.pm.org
> http://mail.pm.org/mailman/listinfo/vienna-pm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/vienna-pm/attachments/20040228/ce1f3f19/attachment.bin


More information about the Vienna-pm mailing list