I'm trying to find all occurrences of pattern that looks like this:
/* 93 */
/* 94 */
/* */
/* 96 */
/* 99 */
/* */
/* 101 */
I've failed miserably producing the correct regex. Desired goal would be to find all that match all the above
Expressions I've treid
(\/)(\*)(\s)(\s)(\d)(\d)(\s)(\*)(\/)
It matches the first occurance of /* somenumber */
but no subsequent matches. It also wont match times when there are three digit numbers and also ones with no numbers
This is what you are looking for
\/\*\s*\d+\s*\*\/
No need of grouping each and every part in regex
unless you want to store it in a group
\\d+
matches 1 to many digits..
\\s*
matches 0 to many spaces..
Try '/* *[0-9 ][0-9 ][0-9 ] **/'
This expression will select just your rows and will not select
/* xxx */
/* c */
/* 1014 */
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.