Find all the words in a file that contain all four lower-case letters “inux” in order

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












The four letters should be in alphabetical order.
For example, inux and ianauax are in the output, but ixnux and naiauax are not.



I can only use grep to accomplish this task.



I tried grep 'iw*nw*uw*xw*' but i failed because ixnux is in the output but it shouldn't be in the output (ixnux is not a word which 'i','n','u','x' are in alphabet order)







share|improve this question


















  • 3




    I wonder if there's some practical application to this, or if this is homework? What about the other letters in between, must they also be in alphabetical order? I.e., is isnux ok?
    – ilkkachu
    Jan 31 at 12:33










  • antineurotoxin Cristineaux fricandeaux influx influxable influxes influxible influxibly influxion influxionism influxious influxive interflux guys...how to make sure all the letters after 'X' are not 'i' 'n' and 'u'?
    – Ulysses
    Jan 31 at 13:05















up vote
1
down vote

favorite












The four letters should be in alphabetical order.
For example, inux and ianauax are in the output, but ixnux and naiauax are not.



I can only use grep to accomplish this task.



I tried grep 'iw*nw*uw*xw*' but i failed because ixnux is in the output but it shouldn't be in the output (ixnux is not a word which 'i','n','u','x' are in alphabet order)







share|improve this question


















  • 3




    I wonder if there's some practical application to this, or if this is homework? What about the other letters in between, must they also be in alphabetical order? I.e., is isnux ok?
    – ilkkachu
    Jan 31 at 12:33










  • antineurotoxin Cristineaux fricandeaux influx influxable influxes influxible influxibly influxion influxionism influxious influxive interflux guys...how to make sure all the letters after 'X' are not 'i' 'n' and 'u'?
    – Ulysses
    Jan 31 at 13:05













up vote
1
down vote

favorite









up vote
1
down vote

favorite











The four letters should be in alphabetical order.
For example, inux and ianauax are in the output, but ixnux and naiauax are not.



I can only use grep to accomplish this task.



I tried grep 'iw*nw*uw*xw*' but i failed because ixnux is in the output but it shouldn't be in the output (ixnux is not a word which 'i','n','u','x' are in alphabet order)







share|improve this question














The four letters should be in alphabetical order.
For example, inux and ianauax are in the output, but ixnux and naiauax are not.



I can only use grep to accomplish this task.



I tried grep 'iw*nw*uw*xw*' but i failed because ixnux is in the output but it shouldn't be in the output (ixnux is not a word which 'i','n','u','x' are in alphabet order)









share|improve this question













share|improve this question




share|improve this question








edited Jan 31 at 14:05









Tomasz

8,04052560




8,04052560










asked Jan 31 at 12:26









Ulysses

496




496







  • 3




    I wonder if there's some practical application to this, or if this is homework? What about the other letters in between, must they also be in alphabetical order? I.e., is isnux ok?
    – ilkkachu
    Jan 31 at 12:33










  • antineurotoxin Cristineaux fricandeaux influx influxable influxes influxible influxibly influxion influxionism influxious influxive interflux guys...how to make sure all the letters after 'X' are not 'i' 'n' and 'u'?
    – Ulysses
    Jan 31 at 13:05













  • 3




    I wonder if there's some practical application to this, or if this is homework? What about the other letters in between, must they also be in alphabetical order? I.e., is isnux ok?
    – ilkkachu
    Jan 31 at 12:33










  • antineurotoxin Cristineaux fricandeaux influx influxable influxes influxible influxibly influxion influxionism influxious influxive interflux guys...how to make sure all the letters after 'X' are not 'i' 'n' and 'u'?
    – Ulysses
    Jan 31 at 13:05








3




3




I wonder if there's some practical application to this, or if this is homework? What about the other letters in between, must they also be in alphabetical order? I.e., is isnux ok?
– ilkkachu
Jan 31 at 12:33




I wonder if there's some practical application to this, or if this is homework? What about the other letters in between, must they also be in alphabetical order? I.e., is isnux ok?
– ilkkachu
Jan 31 at 12:33












antineurotoxin Cristineaux fricandeaux influx influxable influxes influxible influxibly influxion influxionism influxious influxive interflux guys...how to make sure all the letters after 'X' are not 'i' 'n' and 'u'?
– Ulysses
Jan 31 at 13:05





antineurotoxin Cristineaux fricandeaux influx influxable influxes influxible influxibly influxion influxionism influxious influxive interflux guys...how to make sure all the letters after 'X' are not 'i' 'n' and 'u'?
– Ulysses
Jan 31 at 13:05











2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










Another grep approach.



grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' infile





share|improve this answer




















  • Yeah I tried this way but I use [!] in the wildcard and I was wrong :(
    – Ulysses
    Jan 31 at 12:42










  • @αғsнιη, nope, try this grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' <<<"###i nt u--x aaa" - no words here
    – RomanPerekhrest
    Jan 31 at 12:42











  • @Ulysses in regular expression ^ means all but not including these
    – Î±Ò“sнιη
    Jan 31 at 12:44











  • @RomanPerekhrest Yes, but then I doubt for this OP's comment!
    – Î±Ò“sнιη
    Jan 31 at 12:51










  • yeah I finally understand it. Thanks. And then I add [^inux] right after *x because if not, then influxible is still in the output lol. Thanks so much
    – Ulysses
    Jan 31 at 12:53

















up vote
0
down vote













grep solution:



s="inux and ianauax are in the output, but ixnux and naiauax are not."
grep -o 'b[a-h0-9_]*i[a-l0-9_]*n[a-t0-9_]*u[a-y0-9_]*xw*b' <<<"$s"


The output:



inux
ianauax





share|improve this answer




















  • The Wisdom! You the best!
    – Ulysses
    Jan 31 at 12:36










  • @Ulysses, thanks ...
    – RomanPerekhrest
    Jan 31 at 12:36










  • in the wildcard, can I just say 'b[!nux]*i[!iux]*n[!inx]*u[!inu]*xw*b' ?because the word might contains some symbols
    – Ulysses
    Jan 31 at 12:40











  • @Ulysses, the "word" here is [a-Z0-9_] chars only
    – RomanPerekhrest
    Jan 31 at 12:48











  • What about inuxi?
    – Tomasz
    Jan 31 at 14:10










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f420934%2ffind-all-the-words-in-a-file-that-contain-all-four-lower-case-letters-inux-in%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










Another grep approach.



grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' infile





share|improve this answer




















  • Yeah I tried this way but I use [!] in the wildcard and I was wrong :(
    – Ulysses
    Jan 31 at 12:42










  • @αғsнιη, nope, try this grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' <<<"###i nt u--x aaa" - no words here
    – RomanPerekhrest
    Jan 31 at 12:42











  • @Ulysses in regular expression ^ means all but not including these
    – Î±Ò“sнιη
    Jan 31 at 12:44











  • @RomanPerekhrest Yes, but then I doubt for this OP's comment!
    – Î±Ò“sнιη
    Jan 31 at 12:51










  • yeah I finally understand it. Thanks. And then I add [^inux] right after *x because if not, then influxible is still in the output lol. Thanks so much
    – Ulysses
    Jan 31 at 12:53














up vote
0
down vote



accepted










Another grep approach.



grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' infile





share|improve this answer




















  • Yeah I tried this way but I use [!] in the wildcard and I was wrong :(
    – Ulysses
    Jan 31 at 12:42










  • @αғsнιη, nope, try this grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' <<<"###i nt u--x aaa" - no words here
    – RomanPerekhrest
    Jan 31 at 12:42











  • @Ulysses in regular expression ^ means all but not including these
    – Î±Ò“sнιη
    Jan 31 at 12:44











  • @RomanPerekhrest Yes, but then I doubt for this OP's comment!
    – Î±Ò“sнιη
    Jan 31 at 12:51










  • yeah I finally understand it. Thanks. And then I add [^inux] right after *x because if not, then influxible is still in the output lol. Thanks so much
    – Ulysses
    Jan 31 at 12:53












up vote
0
down vote



accepted







up vote
0
down vote



accepted






Another grep approach.



grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' infile





share|improve this answer












Another grep approach.



grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' infile






share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 31 at 12:38









αғsнιη

15k82462




15k82462











  • Yeah I tried this way but I use [!] in the wildcard and I was wrong :(
    – Ulysses
    Jan 31 at 12:42










  • @αғsнιη, nope, try this grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' <<<"###i nt u--x aaa" - no words here
    – RomanPerekhrest
    Jan 31 at 12:42











  • @Ulysses in regular expression ^ means all but not including these
    – Î±Ò“sнιη
    Jan 31 at 12:44











  • @RomanPerekhrest Yes, but then I doubt for this OP's comment!
    – Î±Ò“sнιη
    Jan 31 at 12:51










  • yeah I finally understand it. Thanks. And then I add [^inux] right after *x because if not, then influxible is still in the output lol. Thanks so much
    – Ulysses
    Jan 31 at 12:53
















  • Yeah I tried this way but I use [!] in the wildcard and I was wrong :(
    – Ulysses
    Jan 31 at 12:42










  • @αғsнιη, nope, try this grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' <<<"###i nt u--x aaa" - no words here
    – RomanPerekhrest
    Jan 31 at 12:42











  • @Ulysses in regular expression ^ means all but not including these
    – Î±Ò“sнιη
    Jan 31 at 12:44











  • @RomanPerekhrest Yes, but then I doubt for this OP's comment!
    – Î±Ò“sнιη
    Jan 31 at 12:51










  • yeah I finally understand it. Thanks. And then I add [^inux] right after *x because if not, then influxible is still in the output lol. Thanks so much
    – Ulysses
    Jan 31 at 12:53















Yeah I tried this way but I use [!] in the wildcard and I was wrong :(
– Ulysses
Jan 31 at 12:42




Yeah I tried this way but I use [!] in the wildcard and I was wrong :(
– Ulysses
Jan 31 at 12:42












@αғsнιη, nope, try this grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' <<<"###i nt u--x aaa" - no words here
– RomanPerekhrest
Jan 31 at 12:42





@αғsнιη, nope, try this grep '[^nux]*i[^iux]*n[^inx]*u[^unu]*x' <<<"###i nt u--x aaa" - no words here
– RomanPerekhrest
Jan 31 at 12:42













@Ulysses in regular expression ^ means all but not including these
– Î±Ò“sнιη
Jan 31 at 12:44





@Ulysses in regular expression ^ means all but not including these
– Î±Ò“sнιη
Jan 31 at 12:44













@RomanPerekhrest Yes, but then I doubt for this OP's comment!
– Î±Ò“sнιη
Jan 31 at 12:51




@RomanPerekhrest Yes, but then I doubt for this OP's comment!
– Î±Ò“sнιη
Jan 31 at 12:51












yeah I finally understand it. Thanks. And then I add [^inux] right after *x because if not, then influxible is still in the output lol. Thanks so much
– Ulysses
Jan 31 at 12:53




yeah I finally understand it. Thanks. And then I add [^inux] right after *x because if not, then influxible is still in the output lol. Thanks so much
– Ulysses
Jan 31 at 12:53












up vote
0
down vote













grep solution:



s="inux and ianauax are in the output, but ixnux and naiauax are not."
grep -o 'b[a-h0-9_]*i[a-l0-9_]*n[a-t0-9_]*u[a-y0-9_]*xw*b' <<<"$s"


The output:



inux
ianauax





share|improve this answer




















  • The Wisdom! You the best!
    – Ulysses
    Jan 31 at 12:36










  • @Ulysses, thanks ...
    – RomanPerekhrest
    Jan 31 at 12:36










  • in the wildcard, can I just say 'b[!nux]*i[!iux]*n[!inx]*u[!inu]*xw*b' ?because the word might contains some symbols
    – Ulysses
    Jan 31 at 12:40











  • @Ulysses, the "word" here is [a-Z0-9_] chars only
    – RomanPerekhrest
    Jan 31 at 12:48











  • What about inuxi?
    – Tomasz
    Jan 31 at 14:10














up vote
0
down vote













grep solution:



s="inux and ianauax are in the output, but ixnux and naiauax are not."
grep -o 'b[a-h0-9_]*i[a-l0-9_]*n[a-t0-9_]*u[a-y0-9_]*xw*b' <<<"$s"


The output:



inux
ianauax





share|improve this answer




















  • The Wisdom! You the best!
    – Ulysses
    Jan 31 at 12:36










  • @Ulysses, thanks ...
    – RomanPerekhrest
    Jan 31 at 12:36










  • in the wildcard, can I just say 'b[!nux]*i[!iux]*n[!inx]*u[!inu]*xw*b' ?because the word might contains some symbols
    – Ulysses
    Jan 31 at 12:40











  • @Ulysses, the "word" here is [a-Z0-9_] chars only
    – RomanPerekhrest
    Jan 31 at 12:48











  • What about inuxi?
    – Tomasz
    Jan 31 at 14:10












up vote
0
down vote










up vote
0
down vote









grep solution:



s="inux and ianauax are in the output, but ixnux and naiauax are not."
grep -o 'b[a-h0-9_]*i[a-l0-9_]*n[a-t0-9_]*u[a-y0-9_]*xw*b' <<<"$s"


The output:



inux
ianauax





share|improve this answer












grep solution:



s="inux and ianauax are in the output, but ixnux and naiauax are not."
grep -o 'b[a-h0-9_]*i[a-l0-9_]*n[a-t0-9_]*u[a-y0-9_]*xw*b' <<<"$s"


The output:



inux
ianauax






share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 31 at 12:32









RomanPerekhrest

22.4k12144




22.4k12144











  • The Wisdom! You the best!
    – Ulysses
    Jan 31 at 12:36










  • @Ulysses, thanks ...
    – RomanPerekhrest
    Jan 31 at 12:36










  • in the wildcard, can I just say 'b[!nux]*i[!iux]*n[!inx]*u[!inu]*xw*b' ?because the word might contains some symbols
    – Ulysses
    Jan 31 at 12:40











  • @Ulysses, the "word" here is [a-Z0-9_] chars only
    – RomanPerekhrest
    Jan 31 at 12:48











  • What about inuxi?
    – Tomasz
    Jan 31 at 14:10
















  • The Wisdom! You the best!
    – Ulysses
    Jan 31 at 12:36










  • @Ulysses, thanks ...
    – RomanPerekhrest
    Jan 31 at 12:36










  • in the wildcard, can I just say 'b[!nux]*i[!iux]*n[!inx]*u[!inu]*xw*b' ?because the word might contains some symbols
    – Ulysses
    Jan 31 at 12:40











  • @Ulysses, the "word" here is [a-Z0-9_] chars only
    – RomanPerekhrest
    Jan 31 at 12:48











  • What about inuxi?
    – Tomasz
    Jan 31 at 14:10















The Wisdom! You the best!
– Ulysses
Jan 31 at 12:36




The Wisdom! You the best!
– Ulysses
Jan 31 at 12:36












@Ulysses, thanks ...
– RomanPerekhrest
Jan 31 at 12:36




@Ulysses, thanks ...
– RomanPerekhrest
Jan 31 at 12:36












in the wildcard, can I just say 'b[!nux]*i[!iux]*n[!inx]*u[!inu]*xw*b' ?because the word might contains some symbols
– Ulysses
Jan 31 at 12:40





in the wildcard, can I just say 'b[!nux]*i[!iux]*n[!inx]*u[!inu]*xw*b' ?because the word might contains some symbols
– Ulysses
Jan 31 at 12:40













@Ulysses, the "word" here is [a-Z0-9_] chars only
– RomanPerekhrest
Jan 31 at 12:48





@Ulysses, the "word" here is [a-Z0-9_] chars only
– RomanPerekhrest
Jan 31 at 12:48













What about inuxi?
– Tomasz
Jan 31 at 14:10




What about inuxi?
– Tomasz
Jan 31 at 14:10












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f420934%2ffind-all-the-words-in-a-file-that-contain-all-four-lower-case-letters-inux-in%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay