Regular Expressions 101

Community Patterns

Function parameter selection

0

Regular Expression
Java 8

"
(\"(.+?)\")|(\d+(\.\d*)*)|(\w+)
"
g

Description

Allows to select multiple type of parameters for them to be handled differently. The regex can get strings ( "example string" ), variable name of boolean value ( name or true or false ) or integers and doubles ( 5 or 4.5 ).

The variables names and boolean values have to be checked in the program using this regex as the regex find them both as var names but cannot differentiate a var name from a boolean value.

Submitted by anonymous - 2 years ago