breaking up a string, a regex problem!!
How are you all doing?
I am writing a simple compiler, now I want to break up the source code I have (which is of type string) into tokens, for example if i have something like this
the broken up string should be like this
or in other words I want to break up every WORD in the string along with any word that has . ( ) ; in the middle (like test.callBreak(); ).
I tired StringTokenizer, but it only broke up whole words, and left things like main(), intact, also StringTokenizer is kinda outdated and I rather not use it, after searching around I found out that i could use split(regex), i tried everything but nothing seemed to work!!!
anyone here has some ideas?