c# - Making a conditional regular expression -



c# - Making a conditional regular expression -

i have troubles making regexp:

i want regexp test fail if input contains symbol "<" straight followed letter, i.e like: <[^a-za-z]

but want work if "<" not found. how can that?

edit: examples

<wrong illustration wrong <example illustration < illustration < illustration good< illustration example<

edit 2: when working asp.net, can't send form text in input example:

<previous

edit 3: regular look passed in command cannot change, , works validating input regular expression. hence cannot match bad input

a negative lookahead regex on own like

^(?!.*<[a-za-z])

would check letter never followed left angle bracket, empty string match criteria. need create sure contains @ to the lowest degree 1 alpha, this?

^(?!.*<[a-za-z]).*[a-za-z]

in perl:

while (<data>) { print if /^(?!.*<[a-za-z])/; } __data__ <wrong illustration wrong <example illustration < illustration < illustration good< illustration example<

output

good illustration < illustration < illustration good< illustration example<

c# asp.net .net regex

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -