In regex, β*β matches β0 or moreβ of the previous expression, and β+β matches one or more. "[]" will match any of the characters in brackets. Alternatively, you can use "[^]" to match "not these characters."
For your example, the following regex pattern should work (replace "fixedString" for any fixed string): "fixedString\s*=\s*\("
To learn more about regex, if your field was an arbitrary string, you can use the following: "(\b[a-zA-Z]+\b)\s*=\s*\("
To break it:
"(\b[a-zA-Z0-9]+\b)"
will correspond to the word boundary, at least one alphanumeric character, and then the word boundary (so basically the word consists of nothing but alphanumeric characters )
"\s*"
will match "No spaces / spaces"
"="
will match the equal sign
"\s*"
see above
"\("
will match the character '(' (this must be escaped because '(' means the beginning of a complex expression in the regular expression.)
I recommend using http://www.regextester.com/ if you want to get practice with creating regular expression patterns.
Update: I accidentally put \w
in spaces in the original message. \w
represents the characters of the word (alphanumeric characters plus "_"). It has been replaced with the correct escape character \s
.
source share