Convert Javascript Regexp To Work With Grep Or Sed
I needed to grep some files on a server so I quickly hacked out and tested a regexp in a javascript console to meet my needs: var regexp = /mssql_query\s*\([\'\'][a-z0-9_\s]*(_sp|u
Solution 1:
grep "mssql_query *([\"\'][a-z0-9_ ]*_sp\|usp_"ought to do the job. It is looking for:
- mssql_query, then
- 0 or more spaces (that's the " *"), then
- (, then " or ' (that's the ([\"\']), then
- 0 or more characters that are lowercase letters, numbers, underscores or spaces (that's the [a-z0-9_ ]*), then
- _sp or usp_ (that's the _sp\|usp_)
Post a Comment for "Convert Javascript Regexp To Work With Grep Or Sed"