Regular Expressions 101

Community Patterns

java判断整体多项式的合法性

1

Regular Expression
ECMAScript (JavaScript)

/
(([ ]*[-+]?[ ]*([ ]*([+-]?[ ]*(([1-9]([ ]*[0-9]*)*)[ ]*(\*[ ]*x[ ]*(\^[ ]*([-+]?[1-9][0-9]*))?)?)|([ ]*[-+]?[ ]*x[ ]*(\^[ ]*([-+]?[1-9][0-9]*))?)[ ]*))([ ]*[+-][ ]*([ ]*([+-]?[ ]*(([1-9]([ ]*[0-9]*)*)[ ]*(\*[ ]*x[ ]*(\^[ ]*([-+]?[1-9][0-9]*))?)?)|([ ]*[-+]?[ ]*x[ ]*(\^[ ]*([-+]?[1-9][0-9]*))?)[ ]*))[ ]*)+[ ]*)+)|([ ]*[-+]?[ ]*([ ]*([+-]?[ ]*(([1-9]([ ]*[0-9]*)*)[ ]*(\*[ ]*x[ ]*(\^[ ]*([-+]?[1-9][0-9]*))?)?)|([ ]*[-+]?[ ]*x[ ]*(\^[ ]*([-+]?[1-9][0-9]*))?)[ ]*))[ ]*)
/
gm

Description

java_PTA_6作业

Submitted by anonymous - 4 years ago