Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

What are regular expressions?

OpenStudy (anonymous):

regular expressions defines the syntax of the basic components in the program. They are used in a compiler for the sake of reporting errors. I mean basic components by identifiers etc..without which a program cannot be constructed For eg for any program an identifier(id) is necessary.All these id must follow a syntax.i.e.,they must have only alphanumeric components and also underscore and must not start with a numeric.thats it.any other components the compiler must not accept.Hence the id is defined as follows id:[A-Z|a-z][A-Z|a-z|0-9]*; *means one or more times. First must be only an alphabet. next followed either by a number or an alphabet for any number of times.

OpenStudy (farmdawgnation):

thrylokya's answer above is correct for some cases, however *usually* when most people are talking about regular expressions - they're more generally referring to some code to match a particular string in a block of text. These can be used as mentioned above, but they also have many other applications such as validating email addresses on a website, or finding all text that is in a certain format in a file (such as using the grep command line utility), and can also be used in many languages to do a very advanced find-and-replace operation.

OpenStudy (rsmith6559):

Regular expressions are something like a language for pattern matching. I use them extensively for filtering log files each day when I check them. I have all my desktops (~60) log to one machine's syslog, and I can get everyone's errors and warnings, without making the Windows users give up their machines. There's a lot of crap in that log, so I filter it out. A couple of weeks ago, I had 14000 some odd messages, and I filtered it down to about 200. IMO, one of *nix's strengths is the ability to use regular expressions with grep, awk and sed. I laugh watching Windows admins busting their buts, when I could do the same thing in seconds with *nix.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!