简体   繁体   中英

query params in react router v4

I use regex for path configuration and it works well,

except that when I want to use regex as a pattern for query params, it doesn't recognize question mark in path .

below is my regex pattern.

const regPat = /^confirm/signup/validation\?mobile=09\d{9}$/

thanks for support :)

What do you mean it doesn't recognize the question mark?

This will match the url slugs along with the query

/confirm\/signup\/validation\?mobile=09\d{9}/

You can test it here: regexr share link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM