regex - Java regexp - get parts of string -


i've string contains "unlimited symbols count... [ioiwego|gerqge]" (without brackets). need characters [ ] split on | if string contains it. need [ergerg|gererh] smth ergerg (gererh). first string in [|] (before |) may contain numbers, letters, dots (.) , underscore (_). how can it?

for first pattern:

"unlimited symbols count... [ioiwego|gerqge]".replaceall("([^[]*\[)|(\][^\]]*)","").split("|") 

for second pattern

"[ergerg|gererh] smth ergerg (gererh)".matches("[^[]*\[[\._a-za-z-0-9]*\|[^\]]*\][^\]]*") 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -