我想从1000个word文档文件中提取电子邮件ID,并在python中生成一个csv文件。
答案 0 :(得分:0)
如果您的问题是检测到电子邮件地址,则此abstract class BaseEntity {
static getById(id: number): BaseEntity {...}
}
abstract class BaseObject extends BaseEntity {
static getBySlug(slug: string): BaseObject {...}
}
class User extends BaseObject {}
class Post extends BaseObject {}
class Interactor {
doSomething(obj: new () => BaseObject) { // Since you want to call both method, let's assume "BaseObject" is more fitting
// Since you are in a static context, you have no access to "obj" in the static method as long as you don't pass it (maybe a non-static function would be better?)
BaseEntity.getById(3) // no error
BaseObject.getBySlug('foo') // no error
}
main() {
this.doSomething(User) // no error
this.doSomething(Post) // no error
}
}
代码将为您提供帮助:
Regex
,您应该像这样在python中使用它:
[\w\.-]+@[\w\.-]
以及用于读取或写入csv的其他部分,您可以使用此link。