Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
i'm using a regular expression to check if we can use the scientific notation

here is what i have so far

private void SNotation(String [] data) {
int count =0;
boolean correct = false;
for (int i = 0; i < data.length; i++) {

if (str.matches(" /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/ "){
System.out.println(" it's a floating number ");
correct= true;
break;
}else
correct = false;

}if (correct ==true){
return true;
}else
return false;



}
Posted
Comments
Kornfeld Eliyahu Peter 31-Jan-16 16:28pm    
http://regexper.com/#%5Cd*(%5C.%5Cd*)%3F%5BeE%5D%5Cd*

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900