regex - Conditionals usage -


please elucidate me such issue : how can apply pattern input string depending on other pattern match? example, lalalala hedcbw lulu pol gdte. if pol occurs @ place of string subpattern ,say la{2}, applied string.

see this example @ regex101, if that's mean:

^(?(?=.*\bpol).*?(la{2})|.*?(lu{2})) 

if conditon matches - check @ start: amount of characters, followed \b word-boundary, follwed pol, first pattern used, else second.

read more conditionals.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -