E
E
Excitetic2016-09-30 02:47:41
Regular Expressions
Excitetic, 2016-09-30 02:47:41

How to select a block of characters ending in ]?

Good day.
The log has an id of 16 characters in some such format [a1204f778edb7b4b], you need to get the value without [ ]. I wanted to use this regexp ((\d*\w){16}) . But the problem is that in the log there are words of the form [a-z_]consisting of 16 characters and falling into this regexp. Is it possible to write a regexp that will pull out the id if it is 16 characters and after it is ] but not including the ] itself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2016-09-30
@Excitetic

like this?
https://regex101.com/r/4OCnEL/1 or https://regex101.com/r/4OCnEL/2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question