1. dm
  2. RO CSVI
  3. Friday, 23 October 2020
  4.  Subscribe via email
Hi,

for an xml export, I need to remove all the html and all the particular chars. like this:� or similar.
I'm using the replace rule: /<[\/\!]*?[^<>]*?>/i

But everything is ok.

How can I do?


Thanks.
Davide
Accepted Answer
Accepted Answer Pending Moderation
Hello Davide,
You need to escape / in the regex as it is same as the delimiters. Try the below regex and let me know


/[^a-zA-Z0-9.",'\/ ]+/
Kind regards,

Tharuna

=========================
If you use CSVI, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # Permalink
Accepted Answer Pending Moderation
Hello Davide,
I'm using the replace rule: /<[\/\!]*?[^<>]*?>/i

But everything is ok.

I guess you are trying to say everything is not Ok? :D

What is the output you get with this rule? Can you post an example of what you expect and what is in your product?
Kind regards,

Tharuna

=========================
If you use CSVI, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi Tharuna,

sorry, it was a mistake! :D

The field is the product description, I need to see just the text.
But now I find something strange like:   &nbs and so on.


Thanks.
Davide
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Davide,
You may need to create two more Find and Replace rule to get the text from product description. The below regex will get you only the text leaving behind any special characters.


/[a-zA-Z]+/


Since nbs is text this will not be filtered in with above regex, you need to create another Find and Replace operation to find nbsp and replace empty.

Let me know if that helps.
Kind regards,

Tharuna

=========================
If you use CSVI, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi Tharuna,

I'm sorry, but it's not working.
In attachment the result.


Thanks.
Davide
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Davide,
Can you paste the actual content of product description? The screenshot does not tell me anything on what the product description was before and what has been replaced.
Kind regards,

Tharuna

=========================
If you use CSVI, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hi Tharuna,

sure, you find the description in the Site details.


Thanks.
Davide
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello Davide,
Thank you for posting the content. I have modified the regex a bit and posted it here. Try with the modified regex and check the export. This regex will filter out alphabets, numbers and also space. If you want to let any characters to be left out from replacing you can add the character inside [] like [^a-zA-Z0-9$@ ] for letting $ and @ characters.



/[^a-zA-Z0-9 ]+/
Kind regards,

Tharuna

=========================
If you use CSVI, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hi Tharuna,

thank, we are on the right way, but not perfect yet! :D

This is the output:
pValigia portattrezzi con vasta gamma di utensili per manutenzioni di qulasiasi tipoppCostruita in profilato di alluminio per resistere agli urti e rinforzata con metallo La maniglia telescopica protetta da materiale in plastica

The P in strong I imagine that are the <p> tag in html?
How to remove them?

Probably letteres like that are deleted: è,à,ì


Thanks.
Davide
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello Davide,
Did you remove the Find and Replace rule for HTML tags? You need two Find and replace rule operation with two regex. First one is to remove the HTML tags and the second one is to remove special characters. See the attached screenshot.
Attachments (1)
Kind regards,

Tharuna

=========================
If you use CSVI, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hi Tharuna,

yes, I deleted it, sorry.
Now, this is the result:
Valigia portattrezzi con vasta gamma di utensili per manutenzioni di qulasiasi tipoHERE IS MISSING THE FULL STOPCostruita in profilato di alluminio per resistere agli urti e rinforzata con metallo La maniglia telescopica protetta da materiale in plastica.

Letters like that are deleted: è,à,ì


Thanks.
Davide
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hello Davide,
As i mentioned earlier you need to add characters you need to not replace in your rule. Here you need a full stop so you need to modify your regex to


/[^a-zA-Z0-9. ]+/


Let me know if that works.
Kind regards,

Tharuna

=========================
If you use CSVI, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
Hi Tharuna,

thanks, I did it.
Now I tested to add this symbols: ",' and / but when I add them the description will became empty.


Thanks.


Rregards.
Davide
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hi Tharuna,

thank you very much, now it's perfect.


Regards,
Davide
  1. more than a month ago
  2. RO CSVI
  3. # 13
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!