Questions tagged [pattern-matching]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
27
votes
2answers
1k views

What is the difference between `a[bc]d` (brackets) and `a{b,c}d` (braces)?

What is the difference between a[bc]d and a{b,c}d? Why do people use a{b,c}d when there is already a[bc]d?
4
votes
5answers
259 views

Count the longest stretch of consecutive patterns

I have a sequence file: $ cat file CACCGTTGCCAAACAATG TTAGAAGCCTGTCAGCCT CATTGCTCTCAGACCCAC GATGTACGTCACATTAGA ACACGGAATCTGCTTTTT CAGAATTCCCAAAGATGG I want to calculate the longest stretch of C+T. I ...
7
votes
1answer
718 views

Is there a Unix command that searches for similar strings, based mostly on how they sound when spoken?

I have a file of names, and I want to search within it, not caring too much about whether I have spelled the name ( that I am searching for ) correctly. I know that grep has quite a bit of ...
0
votes
0answers
56 views

grep a sequnce of 'AB<anything>CDE' [duplicate]

I want to grep for 'AB...CDE', where ... stands for anythings until CDE first occurs. I have tried grep 'AB*CDE' filename but this matches til the last occurrence of CDE. How can fix this? ...