I have the next re using the c# regex class:
[^\r\n]+[^,"condicionesDePago"]
searching in the next text:
“CREDITO 30 DIAS”,”condicionesDePago”
I want to get the left part, in this case:“CREDITO 30 DIAS” but i only get : “CREDITO 30
what im missing?
It looks like you have a misunderstanding of what the character class is used for. It doesn’t operate on words, but rather on individual characters. This part of your pattern,
[^,"condicionesDePago"]indicates that a character should be matched provided it is not a comma, double quotes, or specified alphabet in that word.You probably intended to use a look-ahead:
Alternately, this could be written as follows and won’t match
\nas long asRegexOptions.Singlelineisn’t specified (but it can match\r):