如何使用正则表达式删除 ASP .NET AJAX Toolkit 中的选项卡属性

发布于 2024-08-04 18:03:10 字数 554 浏览 4 评论 0原文

我尝试删除 AJAX 控制工具包生成的以下标记。 该场景是我们的 GUI 团队使用 AJAX 控制工具包来制作 GUI,但我需要使用 MultiView 将它们移动到正常的 ASP .NET 视图标记。

我想删除所有 __designer: 属性

代码,

<asp:TextBox ID="a" runat="server" __designer:wfdid="w540" />
<asp:DropdownList ID="a" runat="server" __designer:wfdid="w541" />
.....
<asp:DropdownList ID="a" runat="server" __designer:wfdid="w786" />

这是我尝试在 Visual Studio 中使用正则表达式查找替换的

使用:查找:

:__designer\:wfdid="w{([0-9]+)}"

替换为空白

任何正则表达式专家都可以提供帮助吗?

I have tried to remove the following tag generated by the AJAX Control toolkit.
The scenario is our GUI team used the AJAX control toolkit to make the GUI but I need to move them to normal ASP .NET view tag using MultiView.

I want to remove all the __designer: attributes

Here is the code

<asp:TextBox ID="a" runat="server" __designer:wfdid="w540" />
<asp:DropdownList ID="a" runat="server" __designer:wfdid="w541" />
.....
<asp:DropdownList ID="a" runat="server" __designer:wfdid="w786" />

I tried to use the regular expression find replace in Visual Studio using:

Find:

:__designer\:wfdid="w{([0-9]+)}"

Replace with empty space

Can any regular expression expert help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不知所踪 2024-08-11 18:03:10

如果你想摆脱 __designer:mapid="22"

使用这个正则表达式

<__designer:mapid=:q

If you want to get rid of __designer:mapid="22"

use this regex

<__designer:mapid=:q

阳光下慵懒的猫 2024-08-11 18:03:10
/*
 * Created by SharpDevelop.
 * User: box
 * Date: 2009-9-13
 * Time: 8:13
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Text.RegularExpressions;

namespace t1
{
    class Sample
    {
        public static void Main()
        {
            // Create a regular expression that matches a series of one
            // or more white spaces.
            string pattern = @"__designer:wfdid=""w\d+""";
            Regex rgx = new Regex(pattern);

            // Declare a string consisting of text and white spaces.
            string aspCode = @"<asp:TextBox ID=""a"" runat=""server"" __designer:wfdid=""w540"" />";

            // Replace runs of white space in the input string with a
            // comma and a blank.
            string outputStr = rgx.Replace(aspCode, ", ");

            // Display the resulting string.
            Console.WriteLine("Pattern:       \"{0}\"", pattern);
            Console.WriteLine("Input string:  \"{0}\"", aspCode);
            Console.WriteLine("Output string: \"{0}\"", outputStr);
        }
    }
}
/*
 * Created by SharpDevelop.
 * User: box
 * Date: 2009-9-13
 * Time: 8:13
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Text.RegularExpressions;

namespace t1
{
    class Sample
    {
        public static void Main()
        {
            // Create a regular expression that matches a series of one
            // or more white spaces.
            string pattern = @"__designer:wfdid=""w\d+""";
            Regex rgx = new Regex(pattern);

            // Declare a string consisting of text and white spaces.
            string aspCode = @"<asp:TextBox ID=""a"" runat=""server"" __designer:wfdid=""w540"" />";

            // Replace runs of white space in the input string with a
            // comma and a blank.
            string outputStr = rgx.Replace(aspCode, ", ");

            // Display the resulting string.
            Console.WriteLine("Pattern:       \"{0}\"", pattern);
            Console.WriteLine("Input string:  \"{0}\"", aspCode);
            Console.WriteLine("Output string: \"{0}\"", outputStr);
        }
    }
}
九厘米的零° 2024-08-11 18:03:10

从“查找选项”使用通配符搜索:

__designer:wfdid="*"

找到全部并替换为空。

from 'Find option' use Wildcards search :

__designer:wfdid="*"

find All of them and replace with empty.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文