我有这样的字符串:匹配字符串,但不是一个特殊的子
new_account_notification
updated_account_notification
reactivated_account_notification
updated_billing_info_notification
我想匹配这些字符串作为这样的:
- 应该包含
account
- 但不应包含
reactivated_account
- 或应该包含
billing_info
请建议一个正则表达式来满足这些条件。
我有这样的字符串:匹配字符串,但不是一个特殊的子
new_account_notification
updated_account_notification
reactivated_account_notification
updated_billing_info_notification
我想匹配这些字符串作为这样的:
account
reactivated_account
billing_info
请建议一个正则表达式来满足这些条件。
哪个正则表达式的味道你使用? – Stephan
@Alex:我正在尝试使用我的Ruby程序。 – Vishal