You must select all the words containing the word reg with any number of letters and numbers in front, except those that are limited to a slash. For example, to fit:
Amreg 1reg reg But so as not to come
/Amreg /reg /1reg Help me please(
You must select all the words containing the word reg with any number of letters and numbers in front, except those that are limited to a slash. For example, to fit:
Amreg 1reg reg But so as not to come
/Amreg /reg /1reg Help me please(
var txt = ` Amreg /1reg 1reg /reg /Amreg reg `; console.log(txt.match(/^([^/\s]*?reg)$/gm)); /^([^/\s]*?reg)$/gm
^ - from the beginning of the line;[^/\s] - any character except slashes, spaces, tabs and line breaks;*?reg - match to the nearest reg ;() - match capture;$ - end of line.Flags: g - full text search, m - multiline text.
If the syntax allows, you can use the preview back:
\b(?!/)\w*reg\w* If not, you can do so.
[^/](\w*reg\w*) and take the first group.
Source: https://ru.stackoverflow.com/questions/942594/
All Articles
[^\/]*reg? - Pavel^[^\/]*reg? - Pavel/\b(?<!\/)\w*reg/?/\b(?<!\/)\w*reg\w*/?/\b(?<!\/)\w*reg\w*/u? - Wiktor Stribiżew