Bug 12066 - VB Like operator another bug
Summary: VB Like operator another bug
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: VB Runtime ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2013-05-02 04:37 UTC by Levente Nagy
Modified: 2013-05-10 17:17 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
the whole solution in one file (2.97 KB, text/plain)
2013-05-02 05:50 UTC, Levente Nagy
Details
one more little fix (2.99 KB, text/plain)
2013-05-10 17:17 UTC, Levente Nagy
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 12066 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Levente Nagy 2013-05-02 04:37:36 UTC
In case if the source is null and the pattern is "[]" it throws ArgumentNullException instead of returning true just like VB6 and .NET
Comment 1 Levente Nagy 2013-05-02 05:50:21 UTC
Created attachment 3905 [details]
the whole solution in one file

rename the method to suit for Mono and of course remove the extension method syntax
Comment 2 Levente Nagy 2013-05-02 06:50:39 UTC
Comment on attachment 3905 [details]
the whole solution in one file

VB6 returns false for eastern arabic numbers but VB.NET returns true.
change \d to [0-9] if it is not needed to match eastern arabic numbers.
I think it should behave like the old VB6 like operator and not like the VB.NET like operator, although it's buggy as well for some other reason:
https://connect.microsoft.com/VisualStudio/feedback/details/748415/a-bug-in-net-like-operator

eastern arabic numerals matching:
http://stackoverflow.com/questions/6479423/does-d-in-regex-mean-a-digit

Example run:
string: ٣
pattern: #
Comment 3 Levente Nagy 2013-05-10 17:17:05 UTC
Created attachment 3948 [details]
one more little fix

if (source.Length < pattern.Length)
changed to
if (source.Length < pattern.IndexOf("[") + 1)