J
JT Kimbell
Hey everyone,
Right now I have an array of terms and I want to delete/find a term
using pattern matching.
For example, I have the following array (this is a very simple example).
x = ["dog", "cat", "moose"]
x.include?(/dog/) returns false.
Now, I understand regular expressions, and can usually get one that
works, but perhaps I am using them wrong in ruby?
Anyway, my question is if I can use regex to find an array element(s)?
Thanks,
JT
Right now I have an array of terms and I want to delete/find a term
using pattern matching.
For example, I have the following array (this is a very simple example).
x = ["dog", "cat", "moose"]
x.include?(/dog/) returns false.
Now, I understand regular expressions, and can usually get one that
works, but perhaps I am using them wrong in ruby?
Anyway, my question is if I can use regex to find an array element(s)?
Thanks,
JT