Re: How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-24 Thread Christian Walde
Do not use a single regex for this and instead build a proper parser with mgc parsing. You can check this module for prior art along those lines: https://metacpan.org/source/MITHALDU/Locale-Simple-0.017/lib/Locale/Simple/Scraper/Parser.pm It is based on Parser::MGC, which is very useful for th

Re: How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-22 Thread Jim Gibson
On May 22, 2014, at 2:04 AM, wrote: > I need to extract some information from source code. > > How can I write a perl regular expression that will match a literal string in > languages like C#, javascript, java and lisp? > > Here is my naive approach: > > /"[^"]*"/ > > This of course does

Re: How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-22 Thread Rob Dixon
On 22/05/2014 10:04, siegfr...@heintze.com wrote: I need to extract some information from source code. How can I write a perl regular expression that will match a literal string in languages like C#, javascript, java and lisp? Here is my naive approach: /"[^"]*"/ This of course does not accom

Re: How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-22 Thread Jing Yu
On 22 May 2014, at 10:04, siegfr...@heintze.com wrote: > I need to extract some information from source code. > > How can I write a perl regular expression that will match a literal string in > languages like C#, javascript, java and lisp? > > Here is my naive approach: > > /"[^"]*"/ > > Thi

How to parse C#, javascript, lisp source code for quoted literal strings

2014-05-22 Thread siegfried
I need to extract some information from source code.How can I write a perl regular _expression_ that will match a literal string in languages like C#, _javascript_, java and lisp?Here is my naive approach:/"[^"]*"/This of course does not accommodate backslashes in the string that perl, C, C# _javas