Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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, 7 months ago by dohodoho.
    #597555

    Hey 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,
    Rikard

    #597605

    Please 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, 7 months ago by dohodoho.
    #598254

    Hey!

    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!
    Ismael

    #598264

    I 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.png

    This 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.png

    Please 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, 7 months ago by dohodoho.
    #598336

    Hi!

    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,
    Josue

    #598547

    I 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”

    #598550

    I 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, 7 months ago by dohodoho.
    #598600

    Hey!

    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

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.