regular expression to parse 0,xx/xx/xx and replace 0 in GPEP 
Author Message
 regular expression to parse 0,xx/xx/xx and replace 0 in GPEP

Hi folks

I'm fairly new to the wonderful and terse world or regular expressions...

I need to find the string

0,xx/xx/xx and replace the 0.  There may not be a xx before the first
forward slash.

Any ideas find and replace the "0" with a "D" would be cool.....


thanks in advance and patience with the anti-spammer stuff....



Tue, 13 Nov 2001 03:00:00 GMT  
 regular expression to parse 0,xx/xx/xx and replace 0 in GPEP

Quote:

>Hi folks

>I'm fairly new to the wonderful and terse world or regular expressions...

>I need to find the string

>0,xx/xx/xx and replace the 0.  There may not be a xx before the first
>forward slash.

>Any ideas find and replace the "0" with a "D" would be cool.....


>thanks in advance and patience with the anti-spammer stuff....

To replace it try using sed

sed -e 's:0\(,xx/xx/xx\):D\1:g' -e 's:0\(,/xx/xx\):D\1:g' infile > outfile

man sed

If you want an email reply, give an easy to use email address, you didn't.

Chuck Demas
Needham, Mass.

--
  Eat Healthy    |   _ _   | Nothing would be done at all,

  Die Anyway     |    v    | That no one could find fault with it.



Tue, 13 Nov 2001 03:00:00 GMT  
 regular expression to parse 0,xx/xx/xx and replace 0 in GPEP

Quote:

> I need to find the string
> 0,xx/xx/xx and replace the 0.  There may not be a xx before the first
> forward slash.

Assuming the "xx" is the metasyntactic "xx" meaning any two characters,
try:
   sed -e 's/0\(,\(..\)\?\/..\/..\)/D\1/g'

If you mean a literal "xx", then try:
   sed -e 's/0\(,\(xx\)\?\/xx\/xx\)/D\1/g'

--
Mail to henke at insync dot net.



Tue, 13 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Page xx of xx?

2. page xx of XX

3. xx 2GB xx 1GB USB Flash Memory Drive

4. xx 2GB xx 1GB USB Flash Memory Drive

5. Re on Re: Message Loop [Enter xx, xx]

6. xx 2GB xx 1GB USB Flash Memory Drive

7. DOS Functions from MS Fortran versions 3.xx to 5.xx

8. MTU setting in OS9.xx

9. converting assemby code for use in PowerBASIC v3.xx instead QB45/PDS71

10. Using Relate:xx.Update

11. WTB: Smalltalk/V Mac v2.xx

 

 
Powered by phpBB® Forum Software