Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • That makes sense! Thanks for your help :) Commented Feb 27, 2020 at 0:32
  • @Jo-el Welcome to stack overflow, if you found what you were looking for, you should click the tick icon next to the answer to indicate correct answer. This ensures if people come here again with the same question, they can view the correct answer at the top. Commented Feb 27, 2020 at 7:43
  • For some reason I didn't see the checkmark last time I checked here - maybe my login expired or something - I had thought that maybe I couldn't 'accept' an answer anymore now that this was dup'ed [with a question that doesn't cover the specifics of this case..]. Thanks again :) Commented Feb 28, 2020 at 17:42
  • Actually, followup on this. Is the right way to think about | that it's trying to capture the whole "word" before and after it? For instance 1 2|3 should match 1 2 or 1 3? So my mistake was thinking that adding groups around the (a) and (//) would break the precedence, when in practice to regex they are still the same "word". Is that correct? Commented Feb 28, 2020 at 17:47
  • The | has the lowest precedence, when you don't use (, ) it'll assume everything before it is the first alternative and everything after it will be considered as the second alternative. 1 2|3 will match either 1 2 or 3 More info Commented Feb 28, 2020 at 18:06