正则匹配这段数字

Image

如图我想正则匹配这com
和u0_a之间的这段段数字该怎么写
文本内容如下:
1591 510 1331096 33476 SyS_epoll_ 0000000000 S com.tencent.mobileqq:peak
root 1624 2 0 0 worker_thr 0000000000 S kworker/3:3
root 1885 2 0 0 rescuer_th 0000000000 S IPCRTR
root 1895 2 0 0 rescuer_th 0000000000 S wcnss_IPCRTR
root 2028 2 0 0 rescuer_th 0000000000 S ipawq46
root 2029 2 0 0 rescuer_th 0000000000 S iparepwq46
u0_a250 2147 510 1654520 173576 SyS_epoll_ 0000000000 S com.segmentfault.app
u0_a250 2188 510 1145740 16556 SyS_epoll_ 0000000000 S com.segmentfault.app:pushservice
u0_a49 2524 509 1673640 20120 SyS_epoll_ 0000000000 S com.android.mp
u0_a150 2538 510 1864940 17756 SyS_epoll_ 0000000000 S com.tencent.mm:exdevice
u0_a164 2816 510 1135004 9988 SyS_epoll_ 0000000000 S com.halo.wifikey.wifilocating
u0_a2 3054 509 1682420 18624 SyS_epoll_ 0000000000 S android.process.acore
u0_a45 3072 509 1684200 14384 SyS_epoll_ 0000000000 S com.android.exchange
root 3314 2 0 0 worker_thr 0000000000 S kworker/1:0
u0_a7 3534 509 1697372 40100 SyS_epoll_ 0000000000 S android.process.media
root 3668 2 0 0 worker_thr 0000000000 S kworker/3:1
root 4040 2 0 0 worker_thr 0000000000 S kworker/2:1
root 4058 2 0 0 worker_thr 0000000000 S kworker/0:1
root 4174 2 0 0 worker_thr 0000000000 S kworker/2:3
root 4176 2 0 0 worker_thr 0000000000 S kworker/1:1
u0_a193 4373 26192 3788 1052 0 7f8f5c166c R ps
u0_a94 4413 509 1673396 10088 SyS_epoll_ 0000000000 S com.sutui.stat
u0_a165 4836 510 1132032 27920 SyS_epoll_ 0000000000 S com.gionee.change.engine.vlife:wallpaper
u0_a92 4850 510 1175108 50064 SyS_epoll_ 0000000000 S com.iflytek.inputmethod
u0_a76 4863 509 1693352 19284 SyS_epoll_ 0000000000 S com.baidu.map.location
u0_a18 4931 510 1163984 19948 SyS_epoll_ 0000000000 S com.android.mms
u0_a36 5100 510 1644712 11808 SyS_epoll_ 0000000000 S com.browser_llqhz
u0_a11 5125 510 1846556 76932 SyS_epoll_ 0000000000 S com.android.launcher3
u0_a92 5140 510 1127756 24984 SyS_epoll_ 0000000000 S

阅读 5.7k
3 个回答

/u0_a(.*?)com/

local str = 'u0_a94 4413 509 1673396 10088 SyS_epoll_ 0000000000 S com.sutui.stat'

local i, j = str:find('u0_a[^%.]+')

if i then
    local s =  str:sub(i+4,j-3)
    print(s)
end
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进