|
|
Browse by Tags
All Tags » regex » lookbehind
-
Hello, I am using C# in Visual Studio 2008. I have a text file of the entire Bible that I am wanting to either put into a database or write to an XML document. The format of the text is as follows with comments in C# single line comment style to the right of the actual text (example: Genesis //book ...
-
The problem is with the way you are looking. When you check the character before the , you are telling the regular expression to include it. Use this expression which has a lookbehind expression in it. It will check the character before the comma and not include it in the match.
(?<=[^\\]),
I hope that helps,
Brendan
-
Ok, so you will not be using groups. In that case you can use lookahead and lookbehind with this regular expression.
(?<=((<[^>]*>)[^<>/]*))(padding)(?=([^<>/]*(</[^>]*>)))
It will let you replace the word specified in the middle.
Brendan
|
|
|