i need generate regex match string has following detail correct:
- string should end bracket , numbers inside it.
- end bracket should appear once @ end of line , not else.
- any characters allowed before bracket start
- no characters allowed after bracket end
- string should contain 1 set of brackets numbers, i.e. no double brackets (( or ))
i have tried .\([0-9]+\)$ not required.
for example:
following string should match:
asds-xyz (1) asds+-xyz (12) as@ds-xyz (123) following strings should not matched:
asds-xyz ((1) asds-xyz ((12sdf)) (123) asds-xyz xyz ((2) xyx (1)) xyz (1)(2) xyz(1)bxz xyz(1)bxz(2)
^[^\(\)]*\(\d+\)$ will job...
\d = [0-9]
Comments
Post a Comment