Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day356:提取字符串中所有的uid=123213213格式中的数字? #359

Open
qappleh opened this issue Mar 30, 2021 · 1 comment
Open

Comments

@qappleh
Copy link
Owner

qappleh commented Mar 30, 2021

例如:
给出如下字符串

asdasdasdasddassduid=o12345;
asdsadasduid=fgdf6789;qwwqe,

则需要拿到12345,6789两个数字。

@AimWhy
Copy link

AimWhy commented Apr 1, 2021

function getUidData(str) {
    let result = [];
    String(str).replace(/uid=[^0-9]*([0-9]*)/g, ($0, $1) => result.push($1));
    return result;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants