Reputation: 9326
I was wondering if there was a regex availabe that can match a string and search for a "=" in the string.
Upvotes: 2
Views: 6428
Reputation: 53496
Yes, but why? I simple string search for "=" is usually what you want (see String.IndexOf). Doing a search for "=" using a regex means just using "=" as the regex, nothing special.
If you want to match rather than search you can use the regex .*=.*
Is this what you wanted or am I missing something?
Upvotes: 4
Reputation: 3887
/[=]+/
That will match if there is an = character one or more times anywhere in the string.
Upvotes: 2