Gandalf StormCrow
Gandalf StormCrow

Reputation: 26212

Simple digit extraction with regex

I've got a simple input line :

"12234542","444232343","3323131"

Same string is always received , I'd like to split these into groups with regex such as I'd like for group1 to match 12234542 , group two to match 444232343, and group 3 to match 3323131

Tried this and not working :

[^"]([0-9]+)[^"],[^"]([0-9]+)[^"],[^"]([0-9]+)[^"]

Upvotes: 2

Views: 73

Answers (2)

anubhava
anubhava

Reputation: 785306

You can do:

/"([^"]+)","([^"]+)","([^"]+)"/

Upvotes: 0

hochl
hochl

Reputation: 12950

Do you mean you want to match a group of three such digit strings? Then use

"(\d+)","(\d+)","(\d+)"

as pattern.

Upvotes: 2

Related Questions