KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to extract the last number that is inside a string. I'm trying to do this with regex and negative lookaheads, but it's not working. This is the regex that I have: \d+(?!\d+) And these are some strings, just to give you an idea, and what the regex should match: ARRAY[123] matches 123 ARRAY[123].ITEM[4] matches 4 B:1000 matches 1000 B:1000.10 matches 10 And so on. The regex matches the numbers, but all of them. I don't get why the negative lookahead is not working. Any one care to explain?
Tags (comma-separated)
Save Edits
Cancel