Closed natecook1000 closed 1 year ago
@swift-ci Please test
@swift-ci Please test macOS platform
@swift-ci Please test macOS platform
@swift-ci Please test macOS platform
@swift-ci Please test macOS platform
@swift-ci Please test macOS platform
@swift-ci Please test macOS platform
@swift-ci Please test macOS platform
@swift-ci Please test
When a regex is anchored to the start of a subject, there's no need to search throughout a string for the pattern when searching for the first match: a prefix match is sufficient.
This adds a regex compilation-time check about whether a match can only be found at the start of a subject, and then uses that to choose whether to defer to
prefixMatch
from withinfirstMatch
.(This is a cherry-pick of #682.)