Question: I am using:

```
[RegularExpression(@"^(""|\[)?[a-zA-Z0-9']{1,125}(""|\])?$")]

```

to make sure each line of a multiline textbox is properly matched. I cannot however figure out how to add the global flag and multline flag options. Is it impossible with MVC? What other options do I have?

Answer: 
[You can add an inline option to enable MultiLine](http://msdn.microsoft.com/en-us/library/yd1hzczs.aspx) without having to add a RegexOptions overload to the Attribute. That also ensures the expression will work in Javascript as well.

```
    [RegularExpression(@"(?m)^(""|\[)?[a-zA-Z0-9']{1,125}(""|\])?$")]

```
This is how you would do it with Regex, basically not relying on multiline flag or attribute, instead you explicitly define the regex to allow new lines but the same pattern needs to follow

```
[RegularExpression(@"^(""|\[)?[a-zA-Z0-9']{1,125}(""|\])?(?:\r?\n(""|\[)?[a-zA-Z0-9']{1,125}(""|\])?)*$")]

```