trying to catch the characters at the start the string and newlines the string is
.V/1LBOG\n.F/AV0094/08NOV/SAL/Y\n.E/0134249356001"
the regular expression i am using is from the string above i need to catch .V/ and .E/
^.[VE]/*
But it only seems to ctach .V/ can anyone see why as i thought ^ means newlines aswell as start of strings ? any help will be very gratefull as ive had this problem for a while now. If this is not the correct way as in doing this could you propose a different way.
Regex 101:
^means start of string. And you guessed it right. There can only be one start of string.means :
Match start of string, followed by any character (other than newline), followed by either a V or a E, followed by 0 to n
/(greedy).Probably you want something like this :
Which means match a dot, followed by V or E and match everything until
\nor end of string.Comment if I am wrong.
So
.V/1LBOG\n.F/AV0094/08NOV/SAL/Y\n.E/0134249356001"Looks like this ?
If yes, then you need to change your regex a little bit:
Abusing the fact that
.does not match newlines by default.