d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Regex-help > Short Question
Prev12
Add Reply New Topic New Poll
Member
Posts: 11,637
Joined: Feb 2 2004
Gold: 434.84
Feb 28 2013 07:15am
Quote (Garjust @ Feb 28 2013 04:13am)
Capture groups are for capturing MATCHES. There is no way to match string character indices with a Regex. And there is no neet to, you can just read the characters with the indices.


Shit, I missed the part where he said he has to do it by index. Yeah, abusing capture groups isn't going to help him there.
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Feb 28 2013 08:36am
Quote (Deppi @ Feb 27 2013 10:09pm)
1361936079 account 1103066 removed
1361849622 account TEXTACC removed
1361849661 account 1102605 removed

yeah with those examples it is really easy. As others have suggested just target the spaces and slice out what you want. I was afraid it would be something like
haystackneedlehaystack

But always watch out for false positives. Like for example, lets say you got this data one day:

1361936079 account 1103066 removed
1361849622 account TEXTACC removed
3748838348 account Joe's Crab Shack removed
1361849661 account 1102605 removed

Make sure those extra spaces (in "Joe's Crab Shack") won't fuck you up.

This post was edited by Azrad on Feb 28 2013 08:41am
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll