Thank you everybody for the replies.

My use case is not BBEdit based so I'm not sure it is relevant here (well, I' 
sure it is *not* relevant rather... :)

It is a discussion we're having on emacs-devel where the official split-string 
function will give 2 different results based on wether you use [ab] or a|b as 
an argument for the "trim" regex. There seems to be a bug somewhere since the 
arguments give the same result for [ab] and (a|b), and since I learned 
everything I know about regex with BBLite, I thought about asking here :)

Jean-Christophe 

> On May 10, 2017, at 1:33, Patrick Woolsey <[email protected]> wrote:
> 
> On 5/9/17 at 10:10 PM, [email protected] (Jean-Christophe 
> Helary) wrote:
> 
>> I'm wondering if [] and | are equivalent for single characters or if there 
>> are marginal cases where they would not be equivalent ?
>> 
> 
> Though the expressions [ab] and a|b { or ([ab]) and (a|b) } are functionally 
> equivalent (provided that 'a' and 'b' are unitary characters), I can't 
> guarantee that they are logically equivalent since the alternation operator 
> has a lower precedence (and that I can't think of a counter-example offhand 
> doesn't mean there isn't one :-).
> 
> Since however I would not ordinarily use these expressions interchangeably, 
> may I ask what your use case is?
> 
> 
> Regards,
> 
> Patrick Woolsey
> ==
> Bare Bones Software, Inc.             <http://www.barebones.com/>
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or would like to report a problem, please email
> "[email protected]" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> --- You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/bbedit.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to