Accepted Regular Express


  • 0
    J

    public class Solution {

    public boolean isNumber(String s) {
    
        return s.matches("^\\s*[\\+\\-]?((\\.[0-9]+)|([0-9]+(\\.[0-9]*)?))(e[\\+\\-]?[0-9]+)?\\s*$");
    
    }
    

    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.