Hi Karlis,
One of the things that I think would be very useful is to allow us to use Regular expressions inside the "Replace with" field. For example: Let's say I want to replace all the \n\n with a \n. I would enter "\n\n" inside the "Search for" field and then enter "\n" inside "Replace with" field.
Regular expressions inside the "Replace with" field
Moderator: kfury77
Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
- Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
- Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
- Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".
- chrisjlocke
- Top Contributor
- Posts: 995
- Joined: Mon Aug 01, 2005 4:12 pm
- Location: Essex, UK
- Contact:
Re: Regular expressions inside the "Replace with" field
Moving message to Feature Requests...
- chrisjlocke
- Top Contributor
- Posts: 995
- Joined: Mon Aug 01, 2005 4:12 pm
- Location: Essex, UK
- Contact:
Re: Regular expressions inside the "Replace with" field
WeBuilder allows this already, and has done for some time.

Personally, I don't think you want to be using regular expressions anyway, as you are replacing normal text. The text may represent regular expressions (actually, its just PHP code) but as far as the search and replace dialog is concerned, its normal text.

Personally, I don't think you want to be using regular expressions anyway, as you are replacing normal text. The text may represent regular expressions (actually, its just PHP code) but as far as the search and replace dialog is concerned, its normal text.
Re: Regular expressions inside the "Replace with" field
Actually the regular expressions do not work very well at all (if at all) when replacing, take this example:
Here is a small sample of some XML that I get from a GPS device, when initially viewed on the PC it is all one a single line:
To make it a bit more readable I do a regex search and replace (in my other editor) like this:
Search for: <
Replace with: \n<
And this results in:
Do the same search & replace in WeBuilder I end up with:
Still all on a single line. It's simply inserted "\n" instead of a new line
It's only the search that uses regex rather than the replace.
Here is a small sample of some XML that I get from a GPS device, when initially viewed on the PC it is all one a single line:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mbx="http://www.motionbased.net/mbx" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.motionbased.net/mbx http://www.motionbased.net/site/schemas/mbx/0.0.1/mbx.xsd" creator="MotionBased Technolgies http://www.motionbased.com" version="1.0"><trk><mbx:gpsTrackPk>6055766</mbx:gpsTrackPk><trkseg><trkpt lat="51.682227" lon="-2.355575"><ele>77.0</ele><time>2008-03-27T14:37:13+00:00</time><course>124.54918253409951</course><speed>1.288450119285796</speed></trkpt></trkseg></trk></gpx>
Search for: <
Replace with: \n<
And this results in:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mbx="http://www.motionbased.net/mbx" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.motionbased.net/mbx http://www.motionbased.net/site/schemas/mbx/0.0.1/mbx.xsd" creator="MotionBased Technolgies http://www.motionbased.com" version="1.0">
<trk>
<mbx:gpsTrackPk>6055766
</mbx:gpsTrackPk>
<trkseg>
<trkpt lat="51.682227" lon="-2.355575">
<ele>77.0
</ele>
<time>2008-03-27T14:37:13+00:00
</time>
<course>124.54918253409951
</course>
<speed>1.288450119285796
</speed>
</trkpt>
</trkseg>
</trk>
</gpx>
Code: Select all
\n<?xml version="1.0" encoding="UTF-8"?>
\n<gpx xmlns="http://www.topografix.com/GPX/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mbx="http://www.motionbased.net/mbx" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.motionbased.net/mbx http://www.motionbased.net/site/schemas/mbx/0.0.1/mbx.xsd" creator="MotionBased Technolgies http://www.motionbased.com" version="1.0">\n<trk>\n<mbx:gpsTrackPk>6055766\n</mbx:gpsTrackPk>\n<trkseg>\n<trkpt lat="51.682227" lon="-2.355575">\n<ele>77.0\n</ele>\n<time>2008-03-27T14:37:13+00:00\n</time>\n<course>124.54918253409951\n</course>\n<speed>1.288450119285796\n</speed>\n</trkpt>\n</trkseg>\n</trk>\n</gpx>
It's only the search that uses regex rather than the replace.
- chrisjlocke
- Top Contributor
- Posts: 995
- Joined: Mon Aug 01, 2005 4:12 pm
- Location: Essex, UK
- Contact:
Re: Regular expressions inside the "Replace with" field
Unsure if its meant to work like that or not. Looking at the help, it would suggest so.
A workaround (or, how it also works!) is to click 'Multiline' then search for < and replace with <_ (substitute the _ for pressing return) (or _<, depending on your preference)
A workaround (or, how it also works!) is to click 'Multiline' then search for < and replace with <_ (substitute the _ for pressing return) (or _<, depending on your preference)
Re: Regular expressions inside the "Replace with" field
Nice one, that does indeed work, good find 
