Hello,
I have a code with me, just check out it this is the one you are looking for.
Code:
Public boolean isTwoOperatorSequence(String sentenceToTest)
{
String sg[] = {"+","-","/","*"};
int NBEL = sg.length;
int i = 0;
mt = false;
System.out.System.out.println(correspondence);
while(! mt & & i <NBEL)
{
String opt = sg[i];
String regex = "["opt + +"+]|["opt + +"-]|["opt + +"*]|["opt + +"/]";
System.out.System.out.println(regex);
pat = Pattern.compiles(regex);
= pat mter.mter(sentenceToTest);
mt = mter.find();
i + +;
}
return correspondence;
}
Bookmarks