String search

@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

Jeffrey B. 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)))