Konstantin Mokhov
Konstantin Mokhov

Reputation: 672

take the part of line using regex

i have a line like this: Re: [#244] New Employee .. text text 785 text

How I can get number, between "[# ]" ? If I write \d\d\d it's not be right.

Upvotes: 0

Views: 21

Answers (1)

Anshul Rai
Anshul Rai

Reputation: 782

I'm assuming you want all digits between the square brackets after the #.

Regex: (?=\[#(\d+)\])

Try this DEMO

Upvotes: 2

Related Questions