RegExRX

Posted on  by 



  1. Regular Expression Tester
  2. Regex Rx Program

Kem Tekinay is a Mac consultant and programmer who has been using Xojo since its first release to create custom solutions for clients. He is the author of the popular utilities TFTP Client and RegExRX (both written with Xojo) and lives in Connecticut with his wife Lisa, and two cats. ‎RegExRX on the Mac App Store Automators #34: Getting Cozy with Regular Expressions - Relay FM An introduction to regular expressions – O’Reilly TextMate Renamer - Batch File Renamer for Mac RegExr Website ‎Expressions on the Mac App Store Bare Bones Software BBEdit 13 Hazel for Mac TextExpander Hook – Find without searching.

Trying to wrap my head around RegEx’s Look ahead in order to parse a file. Any assistance is greatly appreciated.

String to parse:

Printer=LPT1 Name=“HP ENVY 110 series” PrinterID=“HP ENVY 110 series” enabled=yes

Goal:
I would like to take the above line and turn it into key value pairs. Notice the quotes surrounding the values are not consistent and only exist on values containing a space. Example below, I would like to find “PrinterID=” then return the characters contained within the quotes and match the data to that key. If happens the value is not surrounded by quotes, then capture the data up to the following space (s).

My regex so far:

RegExRX

Results:

RegExRX

Regular Expression Tester

  • there is a space to the right of the closing quote

And for any others working on RegEx, this site has helped quite a bit.

Regex Rx Program

Thanks in Advance!





Coments are closed