Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3782584
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:06:13+00:00 2026-05-19T11:06:13+00:00

I am looking to find forward slash tags in posts to my website. How

  • 0

I am looking to find forward slash tags in posts to my website. How can I use scan in Rails to do this? This should get the / then the words following. For instance it would be "This is my message /slash" and I am looking to scan for /slash.

@forward_slashes ||= message.scan( )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:06:13+00:00Added an answer on May 19, 2026 at 11:06 am

    I’m not entirely clear on your question, as it’s in broken English. I think you’re just referring to the ruby String method method scan – nothing rails-specific about it.

    It just takes a regular expression. /(\/.*)/ will match from the first forward slash to the end of the string.

    my_string.scan(/\/.*/) {|slash_stuff| puts slash_stuff}

    edit: using \w+ will only return the first word after the slash. .* will return everything until the end of the string.

    edit: using split will break it up into >2 pieces if there are multiple forward slashes, which isn’t clear from your description what you would want for an input of hi / there / person – do you want “/ there / person” (use scan) or ” there ” and ” person” (use split)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Today I'm looking forward of how to use PathOverlay in OSMDroid. I can't find
I am looking forward to develop a secure mobile application. I find my needs
I've tried looking through the documentation, but I can't seem to find (or recognize)
Does anyone know where I can find a Stream splitter implementation? I'm looking to
Should my URL's in Rails look like: http://foobar.com/articles?category=recent - OR - http://foobar.com/articles/recent I find
I was looking forward to find a cause for my application being crushed at
I've been researching this all day and can't seem to find an answer so
I looking forward to find a suitable asp.net DataBound control (C#) to implement in
I am looking forward to find a jQuery code that allows me to have
I'm looking to find alternatives to Solr from the Apache Software Foundation. For those

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.