History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-712
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Snaury
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Support for options after regex

Created: 05/Apr/06 06:00 AM   Updated: 31/May/06 07:48 AM
Component/s: Parser, Compiler
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File df-boo-712.patch (5 kb)



 Description  « Hide
Currently, when I want to use regex options, like RegexOptions.Compile, I have to import System.Text.RegularExpressions, because while Regex type has alias regex, RegexOptions does not. It would be great if regex syntax is extended like this:
/<regex goes here>/[imncsx]

And letters following regular expression are automatically converted into appropriate RegexOptions. All of the letters, except c (Compile) are standard and can be used inline (?[imnsx]), but sadly, c is not there, which is what I use most.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Snaury - 31/May/06 07:48 AM
I've attached the patch against .2250 for this feature. Now code like this is possible:
if /test/i.Match("THIS IS A TEST").Success:
  print "1 - Ok"
if "THIS IS A TEST" =~ /test/i:
  print "2 - Ok"