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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:36:27+00:00 2026-06-13T03:36:27+00:00

I have a string like below atom:link[@me=samiron and @test1=t1 and @test2=t2] and I need

  • 0

I have a string like below

atom:link[@me="samiron" and @test1="t1" and @test2="t2"]

and I need a regular expression which will generate the following back references

#I would prefer to have
$1 = @test1
$2 = t1
$3 = @test2
$4 = t2

#Or at least. I will break these up in parts later on.
$1 = @test1="t1"
$2 = @test2="t2"

I’ve tried something like ( and [@\w]+=["\w]+)*\] which returns only last match and @test2="t2". Completely out of ideas. Any help?

Edit:
actually the number of @test1="t1" pattern is not fixed. And the regex must fit the situation. Thnx @Pietzcker.

  • 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-13T03:36:28+00:00Added an answer on June 13, 2026 at 3:36 am

    This will give you hash which maps “@test1” => “t1” and so on:

    my %matches = ($str =~ /and (\@\w+)="(\w+)"/g);
    

    Explanation: /g global match will give you an array of matches like
    “@test1”, “t1”, “@test2”, “t2”, …

    When hash %matches is assigned to this array, perl will automatically convert array to hash by treating it as key-value pairs.
    As a result, hash %matches will contain what are you looking for in nice hash format.

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

Sidebar

Related Questions

I will have a string like below var str = -#A This text belongs
I have an attribute in my model which contains html string like below: <p>Solution
i have a string like below $string = ' florida' how can i remove
I have an alphanumeric string like below, $string_1 = a4nas60dj71wiena15sdl1131kg12b and would like to
I have a DataTable MyDT like below: string MyConString = SERVER= + sConfig_hostname +
I have a class like the one below: class Foo { private: std::map<std::string, Bar*>
I have string like {param1=foo}{param2=bar}hello world! I need to extract array of tuples (paramName,
I have string like below case1: str = type=\text/xsl\ href=\http://skdjf.sdjhshf/CDA0000=.xsl\ case2: str = href=\http://skdjf.sdjhshf/CDA0000=.xsl\
i have String Like As below : alert(tempstr);//&lt;b&gt; Testing &lt;/b&gt; now I want create
I have a string like below \123\,\Columbia, Gem Of The Ocean\ I want to

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.