2

Requirement;

All Special characters allowed excluding (`) (') () (") and Spaces using below for the same and working fine in ios 10

const UserIdRegExp = /[^`"' \\]$/g;

not working in ios11

const value='anand`';

when i am doing UserIdRegExp.test(value); ios10 return false.

and ios11 return true

Anand Neema
  • 592
  • 1
  • 3
  • 21

1 Answers1

4

In iOS 11 Apple introduced "Smart Punctuation", which automatically slants certain punctuation marks based on content.

const regex = /[^`"“”'‘’ \\]$/g;

Example:

iOS 10: "double quotes", 'single quotes'

iOS 11 (with Smart Punctuation on): “double quotes”, ‘single quotes’

Anand Neema
  • 592
  • 1
  • 3
  • 21