Greedy-Non greedy Pattern search
Hi all!
I am trying to understand the following regular expression.

In the above figure the author have used regular expression to identify G4 motifs in greedy and non-greedy fashion.
- Non-overlapping Greedy (?:(G{3}[ATGC]{1,7}){3}G{3})
- Non-overlapping Non-Greedy (G{3}[ATGC]{1,7}){3}G{3}
- overlapping Greedy (?=((G{3}[ATGC]{1,7}){3}G{3}))
- overlapping non-Greedy (?=((?:(G{3}ATGC{0,6}){3}G{3})))
However I am unable to understand the utility of ?: and ?= and combination thereof (used in last regular expression). Can anyone help? I used the regex
• 799 views
•
link
0 answers
No answers yet.
Log in to answer this question.
please read about ternary operators and zero length assertions.@ rohitsatyam102