From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA07765; Thu, 6 Sep 2001 15:04:02 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA07783 for ; Thu, 6 Sep 2001 15:04:00 +0200 (MET DST) Received: from maties1.sun.ac.za (maties1.sun.ac.za [146.232.128.1]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f86D3wL03493 for ; Thu, 6 Sep 2001 15:03:58 +0200 (MET DST) Received: from bywoner.sun.ac.za ([146.232.129.121]) by maties1.sun.ac.za with esmtp (Exim 3.31 #1) id 15eyoY-0002ic-00 for caml-list@inria.fr; Thu, 06 Sep 2001 15:03:26 +0200 Received: from js by bywoner.sun.ac.za with local (Exim 3.22 #1 (Debian)) id 15eyoY-0003na-00 for ; Thu, 06 Sep 2001 15:03:26 +0200 To: ocaml mailing list Subject: [Caml-list] How to use pcre From: Johann Spies Date: 06 Sep 2001 15:03:26 +0200 Message-ID: <87pu94lbdt.fsf@bywoner.sun.ac.za> User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I have had very limited exposure to Perl and would like to use pcre after reading much about it on this list. I have looked in the documentation that comes with it, but can not find simple examples on how to use it. The example programs are very impressive, but do not help me a lot to know how to use simple things like string substitution. Can somebody please give me a simple example on how to do the following: How do I change a string (let s = "abcde";;) to "abcDe"? In other words what would be the pcre equivalent of python's >>> t = re.sub('d','D',s) >>> t 'abcDe' Regards. Johann -- Johann Spies Telefoon: 021-808 4036 Informasietegnologie, Universiteit van Stellenbosch "Behold, I stand at the door, and knock; if any man hear my voice, and open the door, I will come in to him, and will sup with him, and he with me." Revelation 3:20 ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr