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
Post a Comment