Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
string search
jabowen
6/21/2007 9:05:00 PM
@speed += 1 if sp.slice(8..13) == "03X16"
I've pulled bits 8 though 13 from my string and want
to see if it equal 03X16 where X is number 0-9.
Something like "grep -c 03.16 temp" would work. I've
tried \d of course this did not work.
Thanks
Jeff
____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?...
1 Answer
Tim Hunter
6/21/2007 9:31:00 PM
0
Jeffrey Bowen wrote:
> @speed += 1 if sp.slice(8..13) == "03X16"
>
> I've pulled bits 8 though 13 from my string and want
> to see if it equal 03X16 where X is number 0-9.
> Something like "grep -c 03.16 temp" would work. I've
> tried \d of course this did not work.
>
>
@speed += 1 if (/03\d16/.match(sp.splice(8..13)))
--
RMagick OS X Installer [
http://rubyforge.org/project...
]
RMagick Hints & Tips [
http://rubyforge.org/forum/forum.php?for...
]
RMagick Installation FAQ [
http://rmagick.rubyforge.org/instal...
]
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
string search
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password