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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:05:29+00:00 2026-05-16T15:05:29+00:00

I am studying about regular expression and struck with the lookaround concept and with

  • 0

I am studying about regular expression and struck with the

  1. lookaround concept

    and

  2. with few syntax.

After doing googling, I thought it is a right forum to ask for help.
Please help with this concept.

As I am not good with understanding the explanation.
It will be great if I get plenty of different examples to understand.

For me the modifer /e and || are new in regex please help me in understanding
the real use. Below is my Perl Script.

$INPUT1="WHAT TO SAY";
$INPUT2="SAY HI";
$INPUT3="NOW SAY![BYE]";
$INPUT4="SAYO NARA![BYE]";

$INPUT1=~s/SAY/"XYZ"/e;   # /e What is this modifier is for

$INPUT2=~s/HI/"XYZ"/;

$INPUT3=~s/(?<=\[)(\w+)(?=])/ "123"|| $1 /e; #What is '||' is use for and what its name
$INPUT4=~s/BYE/"123"/e;

print "\n\nINPUT1 = $INPUT1 \n \n ";
print "\n\nINPUT2 = $INPUT2 \n \n ";
print "\n\nINPUT3 = $INPUT3 \n \n ";
print "\n\nINPUT4 = $INPUT4 \n \n ";
  • 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-16T15:05:30+00:00Added an answer on May 16, 2026 at 3:05 pm

    Have a read of perlrequick and perlretut.

    The /e modifier of the s/// substitution operator treats the replacement as Perl code rather than as a string. For example:

    $x = "5 10"
    $x =~ s/(\d+) (\d+)/$1 + $2/e;
    # $x is now 15
    

    Instead of replacing $x with the string “$1 + $2”, it evaluates the Perl code $1 + $2 – where $1 is 5 and $2 is 10 – and puts the result into $x.

    The || is not a regex operator, it’s a normal Perl operator. It is the logical-or operator: if the left-hand side is a true value (not 0 or ”), it returns the left side, otherwise it returns the right side. You can look up perl operators in perlop.

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

Sidebar

Related Questions

I have recently started studying about threads. I thought of starting from the beginning
I am studying for a final and have a few questions about RMI and
I've been studying trees for a few days, and I'm a little confused about
I have started studying about C++0x. I came across the follow expression somewhere: int
After studying ruby for about a month, I decided to move on to Sinatra.
I am trying to understand few things about using dylib and still studying, so
While studying about JMX, I have seen one of the important feature of it
I'm studying The C++ Programming Language from Bjarne Stroustrup and he talks about logical
I am studying the CodeCampServer. I am confused about the ASP.NET MvcContrib.CommandProcessor.RulesEngine. Are there
I'm studying for the Zend PHP certification . I am not sure about the

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.