You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Virtually any 10-plus-digit number is going to be matched, in part, by our regular expression. We really only want to match 9 digit numbers that are not preceded by or followed by digits. I've tried this:
but that also matches the preceding and following characters, returning results like A123-45-6789,. (The ?: ensures that the group isn't stored in memory by regex, but they're still being returned as part of the result.) Figure out how to require the presence of \D before and after, but not return them.
The text was updated successfully, but these errors were encountered:
I think we can address this in Ruby with \K. Instead of beginning and ending the regex with (?:\D), we'd use (\D\K), which means not to keep that portion. Unfortunately, BBEdit 10 (which I'm using to test this regex against the corpus of documents) doesn't support \K, so I can't say for sure that it'll work.
Virtually any 10-plus-digit number is going to be matched, in part, by our regular expression. We really only want to match 9 digit numbers that are not preceded by or followed by digits. I've tried this:
but that also matches the preceding and following characters, returning results like
A123-45-6789,
. (The?:
ensures that the group isn't stored in memory by regex, but they're still being returned as part of the result.) Figure out how to require the presence of\D
before and after, but not return them.The text was updated successfully, but these errors were encountered: