[wp-trac] [WordPress Trac] #44949: Add support for JSON Schema string pattern to REST API

WordPress Trac noreply at wordpress.org
Tue May 12 04:22:54 UTC 2020


#44949: Add support for JSON Schema string pattern to REST API
-------------------------------------------------+-------------------------
 Reporter:  jason_the_adams                      |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  5.5
Component:  REST API                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-refresh good-first-bug has-    |     Focuses:
  patch has-unit-tests                           |
-------------------------------------------------+-------------------------

Comment (by sorenbronsted):

 Replying to [comment:14 birgire]:
 > I wonder if {{{preg_quote()}}} should be used instead of
 {{{str_replace()}}}.
 {{{preg_quote}}} is used to escape special regex characters in your
 string, so they become ordinary characters. So if you put the regex
 {{{a+b}}} through {{{preg_quote('a+b')}}} it becomes {{{a\+b}}}, and
 thereby the special regex character {{{+}}} looses it's meaning.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44949#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list