-
AuthorPosts
-
March 12, 2016 at 10:29 pm #597287
I would like to enter a regular expression for a credit card on a website, see string below. But when I enter it into a Text Block, it parses it differently and I think it is due to all the “\”s in the string. In c# it would be possible to prescript the string with an “@” sign.
Is there anyway I can solve this?
“5(?<=\b(?<!\.)5)[1-5]\d{2}[\W\s]?\d{4}[\W\s]?\d{4}[\W\s]?\d{4}\b”
- This topic was modified 8 years, 9 months ago by dohodoho.
March 14, 2016 at 6:44 am #597555Hey dohodoho,
I’m not sure but please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply.
Best regards,
RikardMarch 14, 2016 at 8:29 am #597605Please just try to place the string “5(?<=\b(?<!\.)5)[1-5]\d{2}[\W\s]?\d{4}[\W\s]?\d{4}[\W\s]?\d{4}\b” in a Text Block item and you will see that it cuts it off. It does not make sense to give you admin login to a commercial site when such an easy test can be done.
- This reply was modified 8 years, 9 months ago by dohodoho.
March 15, 2016 at 8:55 am #598254Hey!
I’m not sure what you’re trying to do here. Could you please elaborate it further? A link to the actual page or a screenshot will help. In the regex above, the less-than and greater-than symbol breaks the string. Try to convert those characters to ascii codes.
Cheers!
IsmaelMarch 15, 2016 at 9:08 am #598264I am trying to display the string “5(?<=\b(?<!\.)5)[1-5]\d{2}[\W\s]?\d{4}[\W\s]?\d{4}[\W\s]?\d{4}\b” in a Text Block. There is no more easy way of explaining it. And the issue is that when I hit “Update” on the page, this text gets parsed.
PLEASE PASTE THE LINKS BELOW IN A NEW TAB – CLICKING THEM DOES NOT WORK FOR SOME REASON
This is how it looks when I enter the string:
http://pasteboard.co/2hifhXq1.pngThis is how it looks after I hit Update to save the page (as you can see it cannot save the string correctly):
http://pasteboard.co/2higDtH8.pngPlease give an example of what I do when I have the individual ascii codes to get them into the TextBlock.
- This reply was modified 8 years, 9 months ago by dohodoho.
March 15, 2016 at 12:30 pm #598336Hi!
This is more of a WordPress TinyMCE thing, one thing you can try is using a shortcode approach (functions.php):
function custom_shortcode_func() { ob_start(); ?> PUT YOUR CODE HERE <?php $output = ob_get_clean(); return $output; } add_shortcode('my_shortcode', 'custom_shortcode_func');
Then you’d put [my_shortcode].
Best regards,
JosueMarch 15, 2016 at 7:08 pm #598547I tried it, it still cuts the string so that I only see “5(?<=\b(?” instead of “5(?<=\b(?<!\.)5)[1-5]\d{2}[\W\s]?\d{4}[\W\s]?\d{4}[\W\s]?\d{4}\b”
March 15, 2016 at 7:16 pm #598550I solved it now. It was the “<!” part of the string. By using a HTML escape character for “<” as “& # 060;” (without the spaces), the problem solved it self.
- This reply was modified 8 years, 9 months ago by dohodoho.
March 15, 2016 at 8:49 pm #598600Hey!
Happy we could help you out.
Btw, If you have a moment, I would very much appreciate if you could quickly rate our theme, which wiII heIp us keep the deveIopment.We really appreciate your feedback and input and again, thanks a lot for using our theme!
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.