From: Robert Linder Date: 2002-09-27T11:13:16+09:00 Subject: String gsub last '/\\%[0-8a-fA-F][0-8a-fA-F]/ match does not sub This is a multi-part message in MIME format. ------=_NextPart_000_0003_01C265A9.E6941CE0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Ruby Versions: ruby 1.6.7 (2002-03-01) [i686-cygwin] and ruby 1.7.3 (2002-09-25) [i386-cygwin] Platform: Windows 2000 SP3 I am using string.gsub to replace "/%[0-8a-fA-F][0-8a-fA-F]/" with "_". The following two gsub is to prove that gsub does sub '%29' "Simple+SNMP+%28s2nmp%29".gsub( /\%2./ , "_" ) ---> "Simple+SNMP+_s2nmp_" "Simple+SNMP+%28s2nmp%29".gsub( /%\d\d/ , "_" ) ---> "Simple+SNMP+_s2nmp_" The following gsub is what I would need to use in a program "Simple+SNMP+%28s2nmp%29".gsub( /%[0-8a-fA-F][0-8a-fA-F]/ , "_" ) ---> "Simple+SNMP+_s2nmp%29" Here is some other strings that did not gsub correctly ruby-aes+%28rijndael%29 "ruby-aes+_rijndael%29" RDE%28Ruby+Development+Environment%29 "RDE_Ruby+Development+Environment%29" eval.rb+%28ANSI%29 "eval.rb+_ANSI%29" Rubonix+%3A%29 "Rubonix+_%29" Ruby%2FOCI8+%28oracle%29 "Ruby_OCI8+_oracle%29" RUDL+%28wraps+SDL%29 "RUDL+_wraps+SDL%29" ruby-termios+%28serial+ports%29 "ruby-termios+_serial+ports%29" Simple+SNMP+%28s2nmp%29 "Simple+SNMP+_s2nmp%29" Quanty+%28units%29 "Quanty+_units%29" Programmieren+mit+Ruby+%28dpunkt.Verlag+Buch%29 "Programmieren+mit+Ruby+_dpunkt.Verlag+Buch%29" Programming+Ruby+%28Hunt%2FThomas%29 "Programming+Ruby+_Hunt_Thomas%29" Ruby+Reference+Manual+%28Windows+HTML+Help%29 "Ruby+Reference+Manual+_Windows+HTML+Help%29" Ruby+Reference+Manual+%2B+RDP+%28HTML+Help%29 "Ruby+Reference+Manual+_+RDP+_HTML+Help%29" Ruby+glossary+%28en%2C+RD%29 "Ruby+glossary+_en_+RD%29" Ruby+Reference+Manual+%28RD%29 "Ruby+Reference+Manual+_RD%29" Ruby+Reference+Manual+%28Texinfo+English%29 "Ruby+Reference+Manual+_Texinfo+English%29" Ruby+Reference+Manual+%28Texinfo%29 "Ruby+Reference+Manual+_Texinfo%29" ObjectDay2000+Ruby+Session%28pdf%2C+Japanese%29 "ObjectDay2000+Ruby+Session_pdf_+Japanese%29" robert_linder_2000@yahoo.com ------=_NextPart_000_0003_01C265A9.E6941CE0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Ruby Versions:

ruby 1.6.7 (2002-03-01) [i686-cygwin]  = and

ruby 1.7.3 (2002-09-25) = [i386-cygwin]

 

Platform: Windows 2000 SP3

 

I am using string.gsub to replace = “/%[0-8a-fA-F][0-8a-fA-F]/” with “_”.

 

The following two gsub is to prove that gsub = does sub ‘%29’

"Simple+SNMP+%28s2nmp%29".gsub( = /\%2./ , "_" )            =           ---> "Simple+SNMP+_s2nmp_"

"Simple+SNMP+%28s2nmp%29".gsub( = /%\d\d/ , "_" = )            =           ---> = "Simple+SNMP+_s2nmp_"

 

The following gsub is what I would need to = use in a program

"Simple+SNMP+%28s2nmp%29".gsub( /%[0-8a-fA-F][0-8a-fA-F]/ , "_" )    ---> "Simple+SNMP+_s2nmp%29"

 

 

Here is some other strings that did not gsub = correctly

ruby-aes+%28rijndael%29   "ruby-aes+_rijndael%29"

RDE%28Ruby+Development+Environment%29   "RDE_Ruby+Development+Environment%29"

eval.rb+%28ANSI%29   = "eval.rb+_ANSI%29"

Rubonix+%3A%29   = "Rubonix+_%29"

Ruby%2FOCI8+%28oracle%29   "Ruby_OCI8+_oracle%29"

RUDL+%28wraps+SDL%29   "RUDL+_wraps+SDL%29"

ruby-termios+%28serial+ports%29   "ruby-termios+_serial+ports%29"

Simple+SNMP+%28s2nmp%29   "Simple+SNMP+_s2nmp%29"

Quanty+%28units%29   = "Quanty+_units%29"

Programmieren+mit+Ruby+%28dpunkt.Verlag+Buch%29 &= nbsp; "Programmieren+mit+Ruby+_dpunkt.Verlag+Buch%29"

Programming+Ruby+%28Hunt%2FThomas%29   "Programming+Ruby+_Hunt_Thomas%29"

Ruby+Reference+Manual+%28Windows+HTML+Help%29 &nb= sp; "Ruby+Reference+Manual+_Windows+HTML+Help%29"

=

Ruby+Reference+Manual+%2B+RDP+%28HTML+Help%29 &nb= sp; "Ruby+Reference+Manual+_+RDP+_HTML+Help%29"

Ruby+glossary+%28en%2C+RD%29   "Ruby+glossary+_en_+RD%29"

Ruby+Reference+Manual+%28RD%29   "Ruby+Reference+Manual+_RD%29"

Ruby+Reference+Manual+%28Texinfo+English%29  = ; "Ruby+Reference+Manual+_Texinfo+English%29"

Ruby+Reference+Manual+%28Texinfo%29   "Ruby+Reference+Manual+_Texinfo%29"

ObjectDay2000+Ruby+Session%28pdf%2C+Japanese%29 &= nbsp; "ObjectDay2000+Ruby+Session_pdf_+Japanese%29"

=

 

robert_linder_2000@yahoo.com

 

------=_NextPart_000_0003_01C265A9.E6941CE0--