#!/usr/bin/perl -wl use strict; $_ = "3 L-homoserine"; /(\w-\w)/; print $1; s/(\d*\s*)L-homoserine/${1}2-Amino-4-hydroxybutyric acid/; print; $_ = "L-homoserine"; s/(\d*\s*)L-homoserine/${1}2-Amino-4-hydroxybutyric acid/; print; __END__ Prints: L-h 3 2-Amino-4-hydroxybutyric acid 2-Amino-4-hydroxybutyric acid
--
John.
In reply to Re: •Re: Re: Regular expressions Containing Octal values?
by jmcnamara
in thread Regular expressions Containing Octal values?
by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |