Regex: selecting between quotation marks with positive lookbehind

I'm struggling to extract data between quotation marks in the following text:

msgid: "something"
msgidd: "something"
msgid:"something"
msgidd:"something"
msgid:      "something"
msgidd:      "something"

With (?<=msgsid:.{1}?)(.+[^"]") I get what follows after msgid: but not always what's inside the quotation marks. My goal is to replace what's inside the quotation marks yet keep msgid: intact. Any help would be appreciated.

Thanks.

Answers


Using lookbehind makes it a lot more difficult as the matching allowed is much more limited. It's easier to do:

(msgid+:\s*)"(.*?)"

And do the replacement as $1"something-replacement"


Need Your Help

How to change banner 260x260 in Indicate-2.1 Themes

wordpress wordpress-theming

When i download and install themes. I see Secondary Sidebar that have some widget defaults

Create Databases Dynamically with Google Cloud SQL and PHP

php sql google-app-engine mysqli google-cloud-sql

I am trying to have a database created for each user that signs up for my web app. This database will be based on a template to store their data.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.