Opened 13 years ago

Last modified 13 years ago

#8510 closed defect

Regex not working properly — at Initial Version

Reported by: chronos.hun@… Owned by: Richard Liao
Priority: normal Component: TracTicketValidatorPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I've configure the trac.ini with the following: [ticketvalidator] validates = summary summary.rule = [0-9]{1,10}.[0-9]{1,6} summary.tip = Please correct summary format validates = cf_project cf_project.rule = [A-Z]*[-][I][P][L][S] cf_project.tip = Please correct project name (SOMETHING-IPLS)

I've tried the regex here: http://www.regexplanet.com/simple/index.html

Test Results Regular Expression Original Expression [0-9]{1,10}.[0-9]{1,6} as a Java string "[0-9]{1,10}.[0-9]{1,6}" Replacement groupCount() 0 Test Target String matches() replaceFirst() replaceAll() lookingAt() find() group(0) 1 12.12 Yes Yes Yes 12.12 2 a12.12 No a a No Yes 12.12 3 1212 No 1212 1212 No No 4 12.12a No a a Yes Yes 12.12 5 23PO-IPLS No 23PO-IPLS 23PO-IPLS No No 6 0000001014.0000132 No 2 2 Yes Yes 0000001014.000013 7 0000001014.000013 Yes Yes Yes 0000001014.000013

So it should work. Could you have a look? Thank you,Chronos

Change History (1)

Changed 13 years ago by chronos.hun@…

Attachment: trac.png added

Regex right, in trac is not working.

Note: See TracTickets for help on using tickets.