ask for regex in java -
ask for regex in java -
i want write regex observe double2
example:
"(no1,no2,double1)(no3,no4,double2)(no5,no6,double3)(no7,no8,double4)"
note: want utilize variables in first , sec numbers.
i.e.:
int nb1 = something1
int nb2 = something2
i seek not work: "\\("+ nb1 +"\\,"+ nb2 +"\\,(\\d)*\\)"
please, help?
try regex:
"\\("+ nb1 +","+ nb2 +",([^)]*)\\)"
you need quantifier (*
) within capture grouping parentheses. also, want match decimal point, can't utilize \\d
; utilize [\\d,]
or suggest (everything closing parentheses).
java regex
Comments
Post a Comment