[wp-trac] [WordPress Trac] #44949: Add support for JSON Schema string pattern to REST API
WordPress Trac
noreply at wordpress.org
Thu Jun 4 18:17:29 UTC 2020
#44949: Add support for JSON Schema string pattern to REST API
-------------------------------------------------+-------------------------
Reporter: jason_the_adams | Owner:
| TimothyBlynJacobs
Type: enhancement | Status: closed
Priority: normal | Milestone: 5.5
Component: REST API | Version:
Severity: normal | Resolution: fixed
Keywords: needs-refresh good-first-bug has- | Focuses:
patch has-unit-tests |
-------------------------------------------------+-------------------------
Comment (by birgire):
Replying to [comment:15 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.
thanks @sorenbronsted, sorry about my little confusion there :-)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44949#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list