0

The original question that gave the idea behind this particular regex is Regex to find content not in quotes.

Let's just modify the original sample a little bit:

INSERT INTO Notifify (to_email, msg, date_log, from_email, ip_from)
VALUES
    (
        :to_email,
        'test teste nonono',
        :22,
        :3mail,
        :ip_from
    )

I know that variables starting with numerals are not allowed in any programming language, but that doesn't mean we can't have scenarios where we need to match just :to_email or :3mail and :ip_from and not :22.

How do we proceed? Me and my friend tried it(theoretically only) this way ->

  • Store all string in a set
  • Subtract the set that contains only numbers

For online testing, I am using RegExr.

Community
  • 1
  • 1
hjpotter92
  • 78,589
  • 36
  • 144
  • 183

2 Answers2

0

i don't know which programming language do you use, but why can't you just check if the line match:

^\s*:[0-9]+,?\s*$

and just take unmatched lines?

Kent
  • 189,393
  • 32
  • 233
  • 301
0

lookaheads will work here

\b(?=\d*[a-z])\w+\b

as will

\b\d*[a-z]\w*\b
Eric
  • 95,302
  • 53
  • 242
  • 374