[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: [TSVN] regex help

From: Eric J. Smith <eric_at_ericjsmith.net>
Date: 2005-02-17 22:01:15 CET

Stefan,

> The test log message:
> this is a test logmessage: issue 2222\nIssue #456, 678, #901, #100 #456
> and the regex string which _should_ match only the issue numbers 2222,
> 456, 678, 901, 100:
> [Ii]ssue #?([0-9]+)(?:(?:, #?([0-9]+))+)?

This should work to capture your issue numbers:

[Ii]ssue(?:(?:,\s*|[Aa]nd\s+|\s+)\#?(\d+))+

It will look for "issue" to start a capture and then take one or more spaces
or "and" and one or more spaces or "," and one or more spaces and then
capture the issue number with or without a preceding "#".

There is no need for a two pass regex for issue numbers, it's just a matter
of becoming competent with the regex syntax. IMO, I don't think you should
have an option for a two pass regex either. I think options only serve to
complicate things.

Eric J. Smith

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Thu Feb 17 22:04:38 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.