简体   繁体   中英

Regex cannot match any character inside quotes

I cant seem to get the following regex to match. I'm having a problem with matching whats inside the {}

The regex is:

\{([\s\w|'.,]*)},\s*(\p{L}+)(.*\*\d+)

And the string to match is this:

value=subarray({'1*MyVar'}, EXCEL.x*48, 1)
value=subarray({'1/MyVar'}, EXCEL.x*48, 1)
value=subarray({'1--MyVar'}, EXCEL.x*48, 1)
value=subarray({'90000'}, EXCEL.x*48, 1)
value=subarray({'Holy Moly'}, EXCEL.x*48, 1)

https://regex101.com/r/frF0eC/3

The first 3 do not match, but the last 2 do match. Any idea how to get them to all match? Instead of using \\w do I have to explicitly match all possible characters?

这涵盖了它

\{([\S| \|'.,]*)},\s*(\p{L}+)(.*\*\d+)

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