I need help with a regex to check if a line matches a line of pipe delineated data. The data will end with a pipe, and is not quoted. Some fields will be empty.
Here’s what I’m trying to use:
Pattern dataPattern = Pattern.compile("(.+)\\|^");
Here is a sample line of data:
GJ 3486|||121.10766667|-83.23302778|295.84892861999998|-24.832649669999999||-0.48399999999999999||.371|2MASS J08042586-8313589|8.9700000000000006|8.3539999999999992|8.1110000000000007||2MASS||
Since I only wanted to see if the line matched the pattern, I thought the one I came up with would look for “blah blah blah |”. Apparently not… can anyone help me out?
Jason
Try this instead.
Some problems with your regex :