use strict;
my $str = 'using System.Linq;
using NineYi.ERPV2.DA.AppDB.Tables;
namespace NineYi.ERPV2.DA.Repositories.DbRepositories
{
/// <summary>
/// AppDbRepository
/// </summary>
public class AppDbRepository : IAppDbRepository
{
/// <summary>
/// AppDbContext
/// </summary>
private AppDbContext _appDbContext;
/// <summary>
/// Initializes a new instance of the <see cref="AppDbRepository" /> class.
/// </summary>
/// <param name="appDbContext">AppDbContext</param>
public AppDbRepository(AppDbContext appDbContext)
{
this._appDbContext = appDbContext;
}
/// <summary>
/// SaveChanges
/// </summary>
public void SaveChanges()
{
this._appDbContext.SaveChanges();
}
/// <summary>
/// QueryUserCoupons
/// </summary>
/// <returns>UserCoupons</returns>
public IQueryable<user_coupon> QueryUserCoupons()
{
return this._appDbContext.user_coupon;
}
/// <summary>
/// QueryPubContents
/// </summary>
/// <returns>PubContents</returns>
public IQueryable<pub_content> QueryPubContents()
{
return this._appDbContext.pub_content;
}
}
}';
my $regex = qr/public ([\w><]+ [\w><]+\(\))\s+{[^}]+}/mp;
my $subst = '\\1;';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html