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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:26:56+00:00 2026-06-08T06:26:56+00:00

I am no expert with Perl and regex. So here is my question. How

  • 0

I am no expert with Perl and regex. So here is my question.

How would I write a regex for matching all words in a string to the right of a specified character and retrieve each word separately in Perl?

I don’t understand how I could match unspecified number of words and then most importantly retrieve it one at a time? If that is not possible what is my best bet in Perl to get this done?

E.G.: I have a C assignment like b=var1+var2. I want to be able to extract var1 and var2 if it exists. The important thing is I do not want to match a specific var1 and var2, but any variable after the assignment operator.

Thanks for the 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-06-08T06:26:58+00:00Added an answer on June 8, 2026 at 6:26 am

    \G/pos may be useful.

    $_ = 'b=var1+var2';
    # force further /g matches to start after the first '='
    /=/g;
    
    while (/(\w+)/g) {
        print "$1\n";
    }
    
    # prints
    # var1
    # var2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not a perl expert and I don't quite get how all of perl's
I'm no Perl expert, so this is probably an easy question. I've been using
I'm no expert at Perl, wondering why the first way of obtaining numSheets is
I'm not very expert with Perl, so I preferred to ask you. I have
Can any expert here please point me to some valid walkthrough on how to
I'm no expert on Regex. I'm trying to create a regular expression that will
I am trying to write a regex that will allow me to parse CSV
The functions REGEX() and TRIM() in this script don't work as I would expect.
I'm new to Perl and playing around screen scraping and regex. I'm trying to
It seems strange to me that Perl would allow a package to export symbols

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.