<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:18:59 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CDRIVER-3773] libbson rejects regular expressions with no options field</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3773</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;This originally appeared in a&#160;test failure in &lt;a href=&quot;https://github.com/mongodb-labs/python-bsonjs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;python-bsonjs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is the failing test: &lt;a href=&quot;https://github.com/mongodb-labs/python-bsonjs/blob/2947fc596c76fa82e47b903785bf1411f1c9be05/test/test_bsonjs.py#L146-L149&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb-labs/python-bsonjs/blob/2947fc596c76fa82e47b903785bf1411f1c9be05/test/test_bsonjs.py#L146-L149&lt;/a&gt;. It fails with these logs:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;ERROR: test_regex (test.test_bsonjs.TestBsonjs)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;----------------------------------------------------------------------&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Traceback (most recent call last):&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;File &quot;/home/travis/build/mongodb-labs/python-bsonjs/test/test_bsonjs.py&quot;, line 147, in test_regex&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;res = bsonjs_loads(&apos;{&quot;r&quot;: {&quot;$regex&quot;: &quot;a*b&quot;}}&apos;)[&apos;r&apos;]&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;File &quot;/home/travis/build/mongodb-labs/python-bsonjs/test/test_bsonjs.py&quot;, line 63, in bsonjs_loads&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;return to_object(bsonjs.loads(json_str))&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;ValueError: Missing &quot;$options&quot; after &quot;$regex&quot;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;This specific test is loading legacy regex syntax without the &lt;tt&gt;$options&lt;/tt&gt; field:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{&quot;r&quot;: {&quot;$regex&quot;: &quot;a*b&quot;}}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;Though based on &lt;tt&gt;_bson_json_read_append_regex&lt;/tt&gt; also rejects the canonical representation of a regex if the &lt;tt&gt;options&lt;/tt&gt; field was missing, like:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{&quot;r&quot;: {&quot;$regularExpression&quot;: { &quot;pattern&quot;: &quot;a*b&quot; }}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;If libbson is passing the BSON corpus tests, I imagine it is not required by the spec that we permit regular expressions without options field. But if other tools may produce this (as the comment in test_bsonjs.py says), it seems worthwhile to not reject.&lt;/p&gt;

&lt;p&gt;For more info about regex representation in JSON, see the extended JSON spec: &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/extended-json.rst&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/blob/master/source/extended-json.rst&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1436986">CDRIVER-3773</key>
            <summary>libbson rejects regular expressions with no options field</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="benji.rewis@mongodb.com">Benji Rewis</assignee>
                                    <reporter username="julius.park@mongodb.com">Julius Park</reporter>
                        <labels>
                            <label>neweng</label>
                    </labels>
                <created>Mon, 10 Aug 2020 15:32:29 +0000</created>
                <updated>Wed, 2 Jun 2021 22:47:18 +0000</updated>
                            <resolved>Wed, 10 Mar 2021 18:11:44 +0000</resolved>
                                    <version>1.17.0</version>
                                    <fixVersion>1.18.0</fixVersion>
                    <fixVersion>1.18.0-alpha</fixVersion>
                                    <component>libbson</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3661024" author="benji.rewis" created="Thu, 11 Mar 2021 23:00:38 +0000"  >&lt;p&gt;As of the commit above, we now support legacy regexes with no options, but not canonical regexes with no options.&lt;/p&gt;</comment>
                            <comment id="3661014" author="xgen-internal-githook" created="Thu, 11 Mar 2021 22:58:47 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benjamin Rewis&apos;, &apos;email&apos;: &apos;32186188+benjirewis@users.noreply.github.com&apos;, &apos;username&apos;: &apos;benjirewis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3773&quot; title=&quot;libbson rejects regular expressions with no options field&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3773&quot;&gt;&lt;del&gt;CDRIVER-3773&lt;/del&gt;&lt;/a&gt; Remove support for canonical regular expressions with no options (#754)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/27f1d6e1be7eb85545ef1ebb14920434ea98d031&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/27f1d6e1be7eb85545ef1ebb14920434ea98d031&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3660232" author="shane.harvey" created="Thu, 11 Mar 2021 20:45:57 +0000"  >&lt;p&gt;Benji and I spoke about this ticket and came to the realization that we&apos;re only asking for the legacy $regex behavior to be changed here, not the canonical $regularExpression format. So can we un-revert this change for $regex?&lt;/p&gt;</comment>
                            <comment id="3660072" author="benji.rewis" created="Thu, 11 Mar 2021 19:35:18 +0000"  >&lt;p&gt;We cannot support regular expressions with no options without a spec change because of an existing spec &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/bson-corpus/tests/top.json#L74..L77&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;test&lt;/a&gt; that checks for a parse error on a regex with no options.&lt;/p&gt;

&lt;p&gt;This ticket would require a larger spec change, which I will look into. For now, I&apos;m reverting the change through &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/754&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this PR&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="3660045" author="xgen-internal-githook" created="Thu, 11 Mar 2021 19:28:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benjamin Rewis&apos;, &apos;email&apos;: &apos;32186188+benjirewis@users.noreply.github.com&apos;, &apos;username&apos;: &apos;benjirewis&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3773&quot; title=&quot;libbson rejects regular expressions with no options field&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3773&quot;&gt;&lt;del&gt;CDRIVER-3773&lt;/del&gt;&lt;/a&gt; Support regular expressions with no options (#751)&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 2e685d183a8d5670d439e40059a34327daed84c7.&lt;br/&gt;
Branch: revert-751-allowNoOptionsRegex.3773&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/152f26563835c4626fb2ac2c0b30b4dfc12965bd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/152f26563835c4626fb2ac2c0b30b4dfc12965bd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3657421" author="benji.rewis" created="Wed, 10 Mar 2021 18:11:44 +0000"  >&lt;p&gt;_bson_json_read_append_regex now supports regular expressions without options in both the legacy and canonical formats.&lt;/p&gt;</comment>
                            <comment id="3657415" author="xgen-internal-githook" created="Wed, 10 Mar 2021 18:10:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benjamin Rewis&apos;, &apos;email&apos;: &apos;32186188+benjirewis@users.noreply.github.com&apos;, &apos;username&apos;: &apos;benjirewis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3773&quot; title=&quot;libbson rejects regular expressions with no options field&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3773&quot;&gt;&lt;del&gt;CDRIVER-3773&lt;/del&gt;&lt;/a&gt; Support regular expressions with no options (#751)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/2e685d183a8d5670d439e40059a34327daed84c7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/2e685d183a8d5670d439e40059a34327daed84c7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3655574" author="benji.rewis" created="Tue, 9 Mar 2021 21:08:18 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/751&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/751&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxm8vz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>