Re: [PATCH] builtin-mailinfo.c: Trim only first pair of square brackets in subject

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roger Leigh <rleigh@xxxxxxxxxx> writes:

> Use a regular expression to match text after "Re:" or any text in the
> first pair of square brackets such as "[PATCH n/m]".  This replaces
> the complex hairy string munging with a simple single  pattern match.

[...]
> +	/* Strip off 'Re:' and/or the first text in square brackets, such as
> +	   '[PATCH]' at the start of the mail Subject. */
> +	status = regcomp(&regex,
> +			 "^([Rr]e:)?([^]]*\\[[^]]+\\])(.*)$",
> +			 REG_EXTENDED);

Sidenote: it probably didn't worked before either, but there are some
broken mail readers in the wold (*cough* MS Outlook *cough*), that
misinterpret RFCs and use translated form of "Re:" e.g. "Odp:" (Polish),
or not strip "Re:" when replying resulting in string of "Re: Re: Re: ...",
or use capitalized form of "Re:", i.e. "RE:", or use yet another form 
e.g. compact form of repeated "Re: Re: Re: ..." in form of "Re(3):".

But I guess it didn't worked before either.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]