samedi 25 avril 2015

RegEx to divide string by +*-/ and keep delimiter?


How can I split a string into pieces every time a "/*-+" appears and keep the delimiter?

I've tried

@new = split( [/\+/]|[/\-/]|[/\//]|[/\*/], $start   );

and this doesn't even work to split in Perl. To keep the delimiter I believe I need something like this

/(?<=\.)/

But I'm not sure how that works.


Aucun commentaire:

Enregistrer un commentaire