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
Post a Comment