Skip to content

Any way to disable /g on regex ? #892

Answered by Sc0th
Sc0th asked this question in Q&A
Aug 30, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Found it, use this at the as the prefix (or suffix) to grab first (or last) entry - (?s:.*)

In the example above \s{2}iOS.+?([\d.]+)(?s:.*) would result in just 15.6.1 being returned.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dgtlmoon
Comment options

@Sc0th
Comment options

Answer selected by dgtlmoon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants