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 7702473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:14:06+00:00 2026-05-31T23:14:06+00:00

I am just trying to figure out what the below means in Ruby. ([^]*)$/

  • 0

I am just trying to figure out what the below means in Ruby.

"([^"]*)"$/   

I have the following code sample in Ruby using cucumber at the moment:

require "watir-webdriver"
require "rspec/expectations"

Given /^I have entered "([^"]*)" into the query$/ do |term|
   @browser ||= Watir::Browser.new :firefox
   @browser.goto "google.com"
   @browser.text_field(:name => "q").set term
end

When /^I click "([^"]*)"$/ do |button_name|
   @browser.button.click
end

Then /^I should see some results$/ do
  @browser.div(:id => "resultStats").wait_until_present
  @browser.div(:id => "resultStats").should exist
  @browser.close
end

I understand at the moment that it is doing a logic check that a button has been clicked. I did a bit of research around and found the following for symbal meanings in Ruby (as I am new to Ruby)

? = method returns a boolean value.   
$ = global variable   
@ = instance variable   
@@ = class variable.   
^ = bitwise XOR operator.   
* = unpack array 

I cannot see to find what the command does. I am trying to clarify exactly how functions are linked to variables and I think this is the final clue for me.

Many thanks in advance for any help.

  • 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-31T23:14:08+00:00Added an answer on May 31, 2026 at 11:14 pm

    It’s a regular expression. The expression is contained between the “/” characters.

    By way of an example and using your code:

    /^I have entered "([^"]*)" into the query$/

    is interpreted as a string that :

    • Matches the beginning of the line (^)
    • Matches “I have entered”
    • Matches a single quote
    • (“) Matches everything that is not a quote ( ([^”]*) )
    • Matches ” into the query”
    • Matches a single quote (“)
    • Matches the end of the line $

    See http://www.tutorialspoint.com/ruby/ruby_regular_expressions.htm for more information on Ruby and Regular expressions.

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

Sidebar

Related Questions

I've been trying to figure out what exactly is happening here. I'm just trying
I'm trying to figure out just how a particular function works on a Facebook
I just went through a bunch of stuff trying to figure out how to
Really struggling to figure this out. Just trying to take in data from php
I'm just learning asp.net mvc and I'm trying to figure out how to move
I'm trying to style Vanilla Forums and I just can't seem to figure out
I have been trying to figure out how to do this and it seems
I'm trying to figure out some C code so that I can port it
In the example below, I'm trying to figure out how to hide the fieldset
I'm trying to figure out how to stream mp3 files using django. I've used

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.