如何在JavaScript中将两个正则表达式合二为一?

时间:2018-12-03 15:30:47

标签: javascript regex

如何在Javascript中将两个正则表达式合而为一?

第一个正则表达式:ALTER TABLE `events` ADD INDEX e_type (type); ALTER TABLE `events` ADD INDEX user_time (user_id, date_time); ALTER TABLE requests ADD INDEX user_time (user_id, date_time); SELECT COUNT(*), e.user_id, e.type FROM `events` e JOIN ( SELECT user_id, Max(r.date_time) last_seen FROM requests r GROUP BY user_id ) r ON e.user_id = r.user_id AND e.date_time > r.last_seen WHERE e.type IN( 3, 5, 6 ) GROUP BY e.user_id, e.type

第二个正则表达式:/^(?:36[0-4]|3[0-5]\d|[12]\d{2}|[0-9]\d?)$/

我尝试过此方法,但不起作用:

  • /^0[0-9].*$/
  • /^(?:36[0-4]|3[0-5]\d|[12]\d{2}|[0-9]\d?)$ | ^0[0-9].*$/
  • /^(?:36[0-4]|3[0-5]\d|[12]\d{2}|[0-9]\d?)$|^0[0-9].*$/

1 个答案:

答案 0 :(得分:3)

您需要将替代(@mixin font-weight($weight) { --weight: #{$weight}; font-variation-settings: "wght" var(--weight), "slnt" var(--angle, 0); font-weight: $weight; } @mixin oblique($angle) { --angle: #{$angle}; font-variation-settings: "slnt" var(--angle), "wght" var(--weight, 400); font-style: oblique #{$angle + deg}; } )分支分组包装。试试这个:

@mixin weight-and-oblique($weight, $oblique)

或者为了简化:

|