Within VS Whidbey it would be very helpful if within the Regular Expression Editor, you had the ability to test the Regular Expression by entering some test input. The steps would be 1. You would enter your Regular Expression as normal. 2. below this a text
box would be added where you could enter test data 3. Press some sort of "Validate" button and get results This would really help speed up testing of Regular Expressions. Anyone else think this would be beneficial? Regards David
Thanks for the suggestion! Unfortunately, we don't have time to add the feature to the Whidbey release of Visual Studio. I've added the suggestion and your comments to my ever growing list of feature suggestions for future versions. Have you had a chance to
play around with Addins? If you're interested in writing a Reg Ex Editor that plugs into Visual studio then an Addin would be the quickest way to do it. Thanks, Sean Laberee
I am working on a Regular Expression Builder which could become an Add-In for Visual Studio .NET 2002/3 and possibly a part of the following version. I'm not sure if and how I might be able to release it, but I'll make something available up here. Any feature
requests? So far, I allow you to provide Source Text and the expression, and I tell you how many matches you have and give you a TreeView listing each match and the Groups and Captures within them. I've also got the same pop-up menu that the Find dialog has,
showing the various Regular Expression constructs and allowing them to be added. I'll think about some common pre-built expressions to add and will work on adding a history DropDown for the expression itself. Thanks, -Scott
This posting is provided "AS IS" with no warranties, and confers no rights.
So far I have no idea. I'd like to share what I have sometime relatively soon, but I'm guessing there are legal and other issues I'll have to learn about before I can do that. I'll post when I know more. In the meantime, are there other requests, or other pre-built
expressions people would recommend I add? One great request I've gotten internally is that I allow executing the selection in addition to the whole expression (like the Query Analyzer does) so that people can break down the expression and see what is working
and what isn't without the clipboard or other editing. -Scott
This posting is provided "AS IS" with no warranties, and confers no rights.
I've made right now a small aspx page that validates your regular expressions against the test data. Also it shows all the groups, captures and matches. Also there is a drop-down list width pre-defined regular expressiones (you can add more if you need). I'm
not very good with regular expressions, so I'm not sure that groups&captures work the way they have too. So, if u have some time - try testing my code. Id you want I can migrate this code from web forms to windows forms or even make an Add In for VS. P.S.
If there are no groups to show - only the matched strings are shown. To see the groups, try this: RE - (\w+)\s+(car) Test Data - One car red car blue car Here is the code: [code] <script runat="server"> Sub Button1_Click(sender As Object, e As EventArgs) dim
strRExp dim strIn strRExp = rExp.text strIn = toCheck.text Dim r As Regex = new Regex(strRExp, RegexOptions.IgnoreCase) Dim m As Match = r.Match(strIn) Dim matchcount as Integer = 0 Dim i As Integer Dim j As Integer Dim g as Group Dim cc As CaptureCollection
Dim gc As GroupCollection Dim c As Capture If m.Success then mCount.Visible = true matchCountLabel.Visible = true vR.text = "" While (m.Success) matchCount += 1 vR.text += m.value & "
" gc = m.Groups If gc.Count - 1 > 0 then For i = 1 to gc.Count-1 g = m.Groups(i) If not g.ToString() = "" then vR.text += " Group " & i & " = '" & g.ToString() & "'
" cc = g.Captures For j = 0 to cc.Count - 1 c = cc(j) vR.text += " Capture " & j & " = '" & c.ToString() _ & "', Position=" & c.Index & "
" Next j End If Next i End If m = m.NextMatch() End While mCount.text = matchCount Else vR.text = "No Match" mCount.Visible = false matchCountLabel.Visible = false End If End Sub Sub REtemplate_SelectedIndexChanged(sender As Object, e As EventArgs) dim myValue
myValue = REtemplate.SelectedIndex if myValue <> 0 then rExp.text = REtemplate.Items(myValue).value Else rExp.text = "" End If End Sub </script> <form runat="server">
Maybe you folks have already found this, but there are a number of stand alone Regular Expression tools out there. "The Regulator" is a free one that is pretty powerful. I just added it as an External Tool in VS and then it's quick to get to.
There are quite a few useful regular expression builders available today. I heard
Regular Expression Builder is a very good C# based tool. You might want to give it a try. Hope this helps, Appan
ASP.NET Team
This posting is provided "AS IS" with no warranties, and confers no rights.
I've built this thing and been using it for a while, so I think it's time to post it. You can find the tool at
http://workspaces.gotdotnet.com/RegexBuilder. It's helped me figure out what was going on when I had an expression which wasn't matching, and hopefully it can help other folks, too. -Scott
This posting is provided "AS IS" with no warranties, and confers no rights.
Hello, one of my sugested predefined regexs would be a list of comma separated e-mails. I need this for an e-card sending portal. The user can send a card to 1 to n people, like this: a@one.com, b@two.com, etc@etcetera.com If in the meantime somebody can help
me, I would apreciatte it a lot. I have found some regular expressions for single emails, but I don't know how to accept 1 to n
With the Regex class you can see one Match, or you can enumerate through all of them. Make an expression which will match one address and then use Regex.Matches to get them all and iterate through the collection which is returned. -Scott
This posting is provided "AS IS" with no warranties, and confers no rights.
RegexLib.com also exposes certain webservices which allow you to: - Search for patterns - Submit patterns - Create a new user account I'd certainly look at extending this feature-set based on recommendations and, of course, I'd love to look at VS integration
:-)
None
0 Points
1 Post
Suggestion: Regular Expression Editor
Dec 04, 2003 09:34 AM|moffatdm|LINK
Member
10 Points
266 Posts
Re: Suggestion: Regular Expression Editor
Dec 04, 2003 03:09 PM|Scott Louvau|LINK
None
0 Points
40 Posts
Re: Suggestion: Regular Expression Editor
Dec 08, 2003 06:05 AM|Morritt|LINK
Member
180 Points
3041 Posts
Re: Suggestion: Regular Expression Editor
Dec 08, 2003 06:24 AM|SreedharK|LINK
http://www.w3coder.org
weblog http://weblogs.asp.net/skoganti
None
0 Points
1 Post
Re: Suggestion: Regular Expression Editor
Dec 17, 2003 12:53 PM|SeanLA-MS|LINK
None
0 Points
568 Posts
Re: Suggestion: Regular Expression Editor
Dec 18, 2003 02:57 PM|angiras|LINK
None
0 Points
9 Posts
Re: Suggestion: Regular Expression Editor
Jan 22, 2004 05:19 PM|scoob|LINK
Member
10 Points
266 Posts
Re: Suggestion: Regular Expression Editor
Jan 23, 2004 12:26 PM|Scott Louvau|LINK
None
0 Points
568 Posts
Re: Suggestion: Regular Expression Editor
Jan 23, 2004 01:13 PM|angiras|LINK
None
0 Points
76 Posts
Re: Suggestion: Regular Expression Editor
Jan 28, 2004 05:25 PM|davidvl2|LINK
Member
10 Points
266 Posts
Re: Suggestion: Regular Expression Editor
Jan 30, 2004 03:55 PM|Scott Louvau|LINK
None
0 Points
76 Posts
Re: Suggestion: Regular Expression Editor
Feb 04, 2004 11:58 AM|davidvl2|LINK
None
0 Points
1 Post
Re: Suggestion: Regular Expression Editor
Feb 05, 2004 06:38 AM|Swinka|LINK
" gc = m.Groups If gc.Count - 1 > 0 then For i = 1 to gc.Count-1 g = m.Groups(i) If not g.ToString() = "" then vR.text += " Group " & i & " = '" & g.ToString() & "'
" cc = g.Captures For j = 0 to cc.Count - 1 c = cc(j) vR.text += " Capture " & j & " = '" & c.ToString() _ & "', Position=" & c.Index & "
" Next j End If Next i End If m = m.NextMatch() End While mCount.text = matchCount Else vR.text = "No Match" mCount.Visible = false matchCountLabel.Visible = false End If End Sub Sub REtemplate_SelectedIndexChanged(sender As Object, e As EventArgs) dim myValue myValue = REtemplate.SelectedIndex if myValue <> 0 then rExp.text = REtemplate.Items(myValue).value Else rExp.text = "" End If End Sub </script> <form runat="server">
Choose regular expression Email Address URL Address
Regular Expression
Text to check
Number of matches:
Press the Validate Button
None
0 Points
1 Post
Re: Suggestion: Regular Expression Editor
Feb 25, 2004 02:09 PM|adutton|LINK
Member
10 Points
340 Posts
Re: Suggestion: Regular Expression Editor
Mar 04, 2004 01:27 AM|appana|LINK
This posting is provided "AS IS" with no warranties, and confers no rights.
Member
10 Points
266 Posts
Re: Suggestion: Regular Expression Editor
May 11, 2004 08:54 PM|Scott Louvau|LINK
None
0 Points
37 Posts
Re: Suggestion: Regular Expression Editor
May 12, 2004 05:12 PM|vialetti|LINK
Member
10 Points
266 Posts
Re: Suggestion: Regular Expression Editor
May 13, 2004 09:52 PM|Scott Louvau|LINK
None
0 Points
299 Posts
Re: Suggestion: Regular Expression Editor
May 19, 2004 12:09 AM|Vintious|LINK
Member
141 Points
127 Posts
ASPInsiders
Re: Suggestion: Regular Expression Editor
Jun 29, 2004 07:24 PM|digory|LINK