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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:40:43+00:00 2026-05-25T16:40:43+00:00

I experienced a problem using regex with awk. In particular I need to find

  • 0

I experienced a problem using regex with awk. In particular I need to find all words in a file that:

  • begin with “un”;
  • are at least 6 character long
  • end with two vowel

(these conditions must be verified contemporaneously).
I’ve used this regex

cat file.txt | awk '{ for(k=1; k<=NF; k++) 
                         if ($k ~ /^un.{2,}[aeiouAEIOU]{2}$/ ) 
                             print $k; }'

the problem is that sometimes works and sometimes not.
I’ve tried it with two files:
test.txt

unaaaiuolaa
unaaaaaa
unbbaa

file.txt

unaaaiuolaa
unarmadio

Mysteriously the regex matches all the words in the first file but only “unarmadio” in file.txt (notice that “unaaaiuolaa” is the same in both files).

May someone explain me why?

  • 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-25T16:40:44+00:00Added an answer on May 25, 2026 at 4:40 pm

    As grok12 said, the problem was an empty space at the end of “unaaaiuolaa”. Deleting it solved the problem.

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

Sidebar

Related Questions

I've experienced a couple of days ago, that a problem with the name of
I experience the following problem while using legacy VC6. I just cann't switch to
I'm a long time developer but not very experienced with DNS. Here's my problem:
I have a problem using $.getScript() on chrome. It doesn't work on chrome browser.
Today I experienced a weird problem while trying to remotely debug an application built
This is a homework assignment and my first experience using RegEx. I am starting
Since including <mvc:annotation-driven/> I have experienced a problem when binding the selections of multi-select
I experienced this problem in VS2010 before, and solved it looking at this SO
Here is my problem: I cannot connect to serial port COM1 using ClipGem (Model:
I'm having a problem when using Infragistics styles, the problem is related to 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.