in reply to Regular Expressions

Given that in your examples the operands are in the character class [a-z] you could split on the boundary between operand and operator using look-behinds and look-aheads. You split either at a point preceded by the character class [a-z] and followed by the negated character class [^a-z] or vice versa, like this

use strict; use warnings; print map {qq{$_->[0] -- $_->[1] -- $_->[2]\n}} map { [ split m {(?x) (?: (?<=[a-z])(?=[^a-z]) | (?<=[^a-z])(?=[a-z]) ) } ] } map {chomp; $_} <DATA>; __END__ a=b a!=b a<b a<=b a>b a>=b

which gives this output

a -- = -- b a -- != -- b a -- < -- b a -- <= -- b a -- > -- b a -- >= -- b

Given a more complex set of operators you would probably be better off taking grinder's approach of setting up a regular expression that matches and captures any operator. As complexity increases a parser solution becomes more appropriate.

I hope this is of use.

Cheers,

JohnGG