
Show the regex you already tried, and why you thought it should work tell us what’s wrong with what you do get… Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. Show the data you have and the text you want to get from that data include examples of things that should match and be transformed, and things that don’t match and should be left alone show edge cases and make sure you examples are as varied as your real data. Screenshots can be pasted from the clipbpard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. All example text should be marked as plain text using the toolbar button or manual Markdown syntax. If the edited one is not working but the previous solution was a “wonderful solution” (and thus presumably working), I recommend you happily use the one that you already called “wonderful”.ĭo you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn answer questions and requests for clarification that are made of you. SEARCH (?s).*?.*? of the tag My name is Prince | Alwaysīest said in Regex: Put a comma on REPLACE html tags: Would produce : My name is Prince | Always musician record producer dancer | actor filmmaker

So, assuming the input text below : My name is Prince | AlwaysĪmerican singer-songwriter. Secondly, modify the syntax of the value of the content attribute of the meta tags, adding a comma and space between each word tag in the content attribute of the nearest tag Well, as Peter said, I think that the best is to consider two successive tasks :įirstly, to copy the contents of the. Yes, I must hit multiple times “replace”. If you always knew the number of words in the title was going to be the same number of words, you could probably make it one operation to populate and split and add commas… but this might be better than doing it manually. I use the \l in the replacement to make the first character of groups 2 and 3 lowercase. I match a space, then an optional | and 0 or more spaces as the separator between tokens (thus removing the | like you show in your example). Hit Replace multiple times until it finishes.īasically, I break the line up into three parts: 1: content=", 2: the text before I want the comma, and 3: the text after the comma.

I would do it in multiple parts: first, start with the regex you current use to populate the tag. I am not sure I understand you (a couple things didn’t translate well, sorry). Said in Regex: Put a comma on REPLACE html ,
