I read: Regular Expression to match string starting with "stop"
I want to search for all strings starting with a _
character using regex search in XCode (in case that matters) which I initially thought I would be able to search for with ^_ but that only returns me lines that start with _ they exclude lines with spaces.
I would like my search to return all of the following:
_foo
_bar
_baz
for example and exclude things like
foo_bar
#_
wholeWord_anotherWord
or any other string that doesnt start with '_' followed by myString (ex _myString is a desired result). Basically I'm looking for all variables following the _ naming convention.
I read: How to ignore whitespace in a regular expression subject string?
I tried "\s*^_"
but that returned me only 'new line'_aString
. Did I misunderstand the solution? What will give me the correct response of any _variable?