M
M
mantovpinets2017-08-31 12:01:16
Regular Expressions
mantovpinets, 2017-08-31 12:01:16

Is there a character in regular expressions that means "not"?

Good day to all.
I have data. However, there are rows in this data in which the data is not written according to the format. For example:
all dates are written in the format dd.mm.yyyy, but there are lines in the file where the date is written, for example, in dd.mm.yy, or there d.m.yyyy, etc. Of course, you can write a regular expression , which describes these inconsistencies, but it would be easier (I think) if there was some tool where you describe the main pattern, but look for all lines that do not match this pattern. Does such a solution exist in regular expressions?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry Dart, 2017-08-31
@mantovpinets

This tool is called a programming language, you want too much from regular expressions.
1) Select a regular expression all lines where d.m.yyyy
2) Convert to dd.mm.yyyy
PROFIT !!
But it’s not the regular season that should convert in any way. Where should she put it? There is an array for this.
In itself, denial is [^a](not a)

O
Olgeir, 2017-08-31
@Olgeir

Look at the constructs
(?= )
(?! )
(?<= )
(?

M
Moskus, 2017-08-31
@Moskus

Strictly speaking, for those who do not know how and do not want to program (surprise: there is nothing wrong with this), there are commercial products like PowerGREP and RegexBuddy that allow you to build very complex processing based on regular expressions (and debug regular expressions themselves). There is nesting, and the use of patterns in file names and paths - it's too much to list.

4
4iloveg, 2017-09-01
@4iloveg

There is
https://regex101.com/r/KUM3u3/1
Write a specific example, I will make a regular expression for it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question