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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:57:26+00:00 2026-06-09T01:57:26+00:00

I am working on doubling all vowels in every word. For eg: $string=if it

  • 0

I am working on doubling all vowels in every word. For eg:

$string="if it rains, cover with umbrella";

Here is the code I wrote, but I am not getting correct output.

$string=~s/a|e|i|o|u/aa|ee|ii|oo|uu/gi; print $string;

Expected Output: iif iit raaiins cooveer wiith uumbreelaa

Can some one help me in this?

  • 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-09T01:57:28+00:00Added an answer on June 9, 2026 at 1:57 am

    The regular expression in your substitution should work fine but, as you will have seen, the replacement string is a simple string that bears no relation to the match unless you capture substrings within the regular expression and use them in the replacement string.

    Use a character class to match any one of a set of characters, like [aeiuo].

    Use parentheses to ‘capture’ part of a match, so that you can use it in the replacement string.

    my $string = "if it rains, cover with umbrella";
    
    $string =~ s/([aeiuo])/$1$1/g;
    
    print $string;
    

    output

    iif iit raaiins, cooveer wiith uumbreellaa
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
I am struggling working with large numpy arrays. Here is the scenario. I am
Working example: http://alpha.jsfiddle.net/gTpWv/ Both of the methods work separately, but once regexp for smilies
Working with Json, how can I NSlog only the title in this code: NSDictionary
Working on a project where I need to add points to an array. Here
Working on dom html . I want to convert node value to string: $html
Working with MVC 2 ad with the help of some friends I thought all
Working SQL The following code works as expected, returning two columns of data (a
Working with COM interop, I can call a managed function from within unmanaged code.
I'm working on some networking code for an iPhone application that interfaces with a

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.