Skip to content
Advertisement

Tag: regex-lookarounds

regex riddle. want results: ‘onetwothree’, ‘onetwo’, ‘twothree’ but NOT ‘two’. Positive lookahead maybe?. For currency extraction

confused with some basic regex logic. Using simple example: I want regex to catch: but NOT and catching in groups (one)(two)(three). I know I can use positive lookahead on ‘two’ so that it is only preceded by ‘one’: but then I cannot get the ‘twothree’ result The real world need is for currency: so I want to get these results:

Advertisement