0

I wrote:

Regular expressions can be used to match several patterns, each of which is enclosed in parentheses.

Could it be:

Regular expressions can be used to match several patterns, each enclosed in parentheses.

How about:

Regular expressions can be used to match several patterns, where each pattern is enclosed in parenthesis.


Update: Example:

([0-9]+)-([0-9]+)-([0-9]+) to match 12-04-1975

The above expression contains three patterns, each enclosed in parentheses.

7
  • 5
    Yes is the simple answer, though the grammar is different. In your first example "each of which" is a relative phrase introducing a relative clause where "patterns" is the antecedent. In your second example "each" is a fused determiner-head whose salient meaning is "each pattern" which heads the gerund-participial clause "each (pattern) enclosed in parenthesis".
    – BillJ
    Sep 10 '16 at 9:30
  • 1
    But you'd want to say "enclosed in parentheses". Sep 10 '16 at 10:46
  • 1
    If you choose each of which or where each pattern you need a finite verb as predicate, "is enclosed". Sep 10 '16 at 15:20
  • @BillJ you mean in my second sentence I should use a dot (end of sentence) before each?
    – Ahmad
    Sep 10 '16 at 15:35
  • @Ahmad No, it's fine as it is.
    – BillJ
    Sep 10 '16 at 15:41
1

As @BillJ commented:

"each of"which" and "each" can be both used interchangeably, however:

  1. Regular expressions can be used to match several patterns, each of which is enclosed in parentheses.

"Each of which" means "each of the several patterns". "Each of which" here requires a verb after it.

  1. Regular expressions can be used to match several patterns, each enclosed in parentheses.

"Each" means "pattern". Here "each" doesn't require a verb after it.

  1. Regular expressions can be used to match several patterns, where each pattern is enclosed in parenthesis.

It is also grammatically correct and carries the same meaning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.