3
3
3err02019-05-31 06:27:33
Regular Expressions
3err0, 2019-05-31 06:27:33

How to compose a Regex to exclude previous characters?

Hello, I am compiling a regex to process data in a Zabbix item.
But since I'm not strong in regular expressions, the following question arose from here
. The following information comes in the element:

123456;789012;order of numbers;order again;and so eleven times

The order of the digits is different, but each order is separated by a semicolon.
I get the first order 123456, respectively, with the following regex
[0-9]+

Since for each required data element I need the order of characters before each semicolon
I try to get the second order as follows:
[^0-9][0-9]+

Removing the first order, I get the next one, but before it I have a semicolon from the previous order, which I did not figure out by all means how to remove the regular expression.
Tell me, kind people, how can I get each order of numbers without getting the previous one, and not having characters in it.
p/s - Need eleven regular expressions to parse one string

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Yakimenok, 2019-05-31
@3err0

Search for numbers ending with a semicolon or the end of a line using positive lookahead:
Link.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question