Fix bug in Example D#6784
Merged
ktoliver merged 1 commit intoMicrosoftDocs:livefrom Oct 15, 2021
Merged
Conversation
The example pattern '%[^ 0-9A-z]%' did not match characters in the range 91-96, even though they are not numbers, letters, or spaces.
For example:
SELECT position = PATINDEX('%[^ 0-9A-Za-z]%', 'Please^ensure the door is locked!');
returns 33, but it should return 7.
With the proposed update, it works correctly.
Contributor
|
@Mankarse : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
Contributor
|
@Mankarse What collation are you using. I am using SQL_Latin1_General_CP1_CI_AS. and the code works as expected. |
Contributor
Author
|
I have tried a variety of different collations. It is true that the original code works correctly in |
Contributor
|
@Mankarse Thank you for the detailed response and for your contribution to Microsoft Docs. |
Contributor
|
#sign-off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The example pattern '%[^ 0-9A-z]%' did not match characters in the range 91-96, even though they are not numbers, letters, or spaces.
For example:
SELECT position = PATINDEX('%[^ 0-9A-z]%', 'Please^ensure the door is locked!');
returns 33, but it should return 7.
With the proposed update, it works correctly.