Piping (multiple) expressions in RegEx

I have a set that varies greatly in general, but I managed to find some similarities. The data may be completely different but they do have same ending classes. I am wondering if it is feasible to use multiple regex expressions with each other (pipe them together with |).

Something like this:

"^([A-Z0-9]+|[d-k0-5]+|[xyz7-9]+)\\s+(Flag1|FLAG1)$";

Would this be a valid design and will that work? Or do I have to make multiple regex strings and run them every time?

Thanks

Answers


There's nothing wrong with doing it that way. This will match strings like:

TEST009 Flag1
def345 FLAG1
zxy789     Flag1

Without any issue.


Need Your Help

How to select results between two dates or by single year/month/day in oracle? (to_date, extract,sysdate)

oracle select plsql oracle11g plsqldeveloper

I have a table for orders and it has 2 column with DATE types: delivery_date and order_date.

WPF semi transparent button to control MediaElement

c# wpf button mediaelement

I am making WPF application that plays a video.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.