I would like to match any character and any whitespace except comma with regex. Only matching any character except comma gives me:
[^,]*
but I also want to match any whitespace characters, tabs, space, newline, etc. anywhere in the string.
EDIT:
This is using sed in vim via :%s/foo/bar/gc.
I want to find starting from func up until the comma, in the following example:
func("bla bla bla"
"asdfasdfasdfasdfasdfasdf"
"asdfasdfasdf", "more strings")
I
Best Answer
To work with
multiline
inSED
usingRegEx
, you should look at here.EDIT:
In
SED
command, working with NewLine is a bit different.SED
command support three patterns to manage multiline operationsN
,P
andD
. To see how it works see this(Working with Multiple Lines) explaination. Here these three operations discussed.My guess is that
N
operator is the area of consideration that is missing from here. Addition ofN
operator will allows to sense\n
in string.An example from here: