Objective
I want to match any digit, word character, or space 46 or more times before a < sign.
One note is that I’m trying to use this RegEx in Notepad++ before plugging it into the C# code.
Data
<Elem1>123 ABC Street</Elem1> // should NOT match
<Elem1>123637 ABC Street Suite 1, Kalamzoo, FL 15264-8574</Elem1>
RegEx
I currently have the following RegEx:
^.*<Elem1>[\d\w\s]{46,}?
and I can’t figure out why this [\d\w\s]{46,}? won’t match the inner portion of the element.
I look forward to your answers!
It doesn’t match because the input contains commas and hyphens, which are not part of any of the three character classes you include.
This would match:
Additionally, it only makes sense to include the start of input anchor and then go on to say “oh, ignore any characters you find before an
<Elem1>” if the regex runs in multiline mode. Otherwise, the same effect can be achieved with just