another "seems to work in Notepad++ but not here"

A place to try and solve your RegEx problems.
Post Reply
schnarkle
Posts: 9
Joined: Thu Aug 18, 2016 2:37 am

another "seems to work in Notepad++ but not here"

Post by schnarkle »

Hello,

on the following text I can search and replace using the below regex but it does no replacement in Textcrawler Pro:

@M_DeathNoticeHed:Alex <\n>Ornelas
@M_DeathNoticeBod:ALAMO <\!-> Alex Ornelas <\n>, 25, died Tuesday, Aug. <\n>16, 2016 at Alamo. Me<\h>morial Funeral Home of <\n>San Juan is in charge of ar<\h>rangements.

@M_DeathNoticeHed:Almaquire Cadena
@M_DeathNoticeBod:RIO GRANDE CITY <\!-> Almaquire <\n>Cadena , 87, died Tues<\h>day, Aug. 16, 2016 at Pax <\n>Villa Hospice, in McAllen, <\n>TX. Sanchez Funeral Home <\n> of Rio Grande City is in <\n>charge of arrangements.

@M_DeathNoticeHed:AnaRose <\n>Collazi
@M_DeathNoticeBod:MISSION <\!-> AnaRose <\n>Collazo , 44, died Wednes<\h>day, Aug. 17, 2016 at Mis<\h>sion Regional Medical Cen<\h>ter in Mission. Virgil Wilson <\n>Mortuary of Mission is in <\n>charge of arrangements.

----
Search param: (@M_DeathNoticeBod:.*)<\\!->
replace: \1—

This replaces the regular dash after the city with an em dash.

Any ideas?

Thanks!
User avatar
DigitalVolcano
Site Admin
Posts: 1379
Joined: Thu Jun 09, 2011 10:04 am

Re: another "seems to work in Notepad++ but not here"

Post by DigitalVolcano »

In TextCrawler you use $ to reference the capturing group - e.g. $1

https://msdn.microsoft.com/en-us/librar ... 2147217396

So for your example this works (at least in the RegEx Tester)

Code: Select all

$1— 
schnarkle
Posts: 9
Joined: Thu Aug 18, 2016 2:37 am

Re: another "seems to work in Notepad++ but not here"

Post by schnarkle »

Thank you!
Post Reply