Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
How to change this ruby match line to return true or false

Ok so my ruby is rusty. I have a line that looks for a match...

self.volunteer_event.description.match(/^Roster #/)

gives me this...

[1] pry(#<VolunteerShift>)> self.volunteer_event.description.match(/^Roster #/)
=> #<MatchData "Roster #">

I want to change it to give me "true" if it has a match or "false" for no

What simple ruby incantation can I use to achieve this?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Looking at the Regexp docs, I see match? and match. Use match? which returns a boolean. Functions that return a boolean often end with ? in Ruby.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!