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

百度移动适配工具正则格式怎么写 #140

Open
bachuan88 opened this issue Apr 12, 2023 · 2 comments
Open

百度移动适配工具正则格式怎么写 #140

bachuan88 opened this issue Apr 12, 2023 · 2 comments

Comments

@bachuan88
Copy link

  百度移动适配工具正则表达式就一个挺复杂的东西,在这里以自己的经验举例,希望对大家对帮助,我们直接来看例子,不要理论。

  *种,纯数字

  电脑网址http://www.8-8.com.cn/news/202303/955.html

  手机网址http://m.8-8.com.cn/news/202303/955.html

  正则表达式:

  http://www.abc.com.cn/([0-9]+).html

  http://m.abc.com.cn/${1}.html

  第二种,纯字母

  http://www.8-8.com.cn/news/

  http://m.8-8.com.cn/news/

  正则表达式:

  http://www.abc.com.cn/([a-zA-Z]+)/

  http://m.abc.com.cn/${1}/

  第三种,数字字母混合

  http://www.8-8.com.cn/brand/list.php/catid-44583/

  http://m.8-8.com.cn/brand/list.php/catid-44583/

  正则表达式:

  http://www.abc.com.cn/((?:[a-zA-Z]+[0-9]+|[0-9]+[a-zA-Z]+)[a-zA-Z0-9]+)/

  http://m.abc.com.cn/${1}/

  正则表达式:

  http://www.abc.com.cn/((?:%[a-zA-Z-0-9]{2,})+)/

  http://m.abc.com.cn/${1}/

  提醒:正式表达式为纯代码内容,复制时请检查前后是否有空格,带空格审核不会通过的。

@hanyufeiyan
Copy link

hanyufeiyan commented Apr 12, 2023 via email

@liangshuangs
Copy link

liangshuangs commented Apr 12, 2023 via email

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

No branches or pull requests

3 participants