Greedy-Non greedy Pattern search
0
0
Entering edit mode
4.4 years ago

Hi all!

I am trying to understand the following regular expression.

enter image description here

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

genome • 513 views
ADD COMMENT
2
Entering edit mode

please read about ternary operators and zero length assertions.@ rohitsatyam102

ADD REPLY

Login before adding your answer.

Traffic: 2743 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6