Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [regex]

Denotes questions related to Regular expressions(regex) being used in magento

1
vote
2answers
20 views

What does this pattern match when filtering strings for URLs

What exactly is this line for preg_replace('#[^0-9a-z]+#i', '-', parent::filter($string)) in the following method in \vendor\magento\framework\Filter\TranslitUrl.php: public function filter($string)...
0
votes
1answer
21 views

Regex for starting with character and rest all are digits

I want a regex of length 13 in which starting word is a alphabet and rest 12 entries are digit. Something like this : A123456789764
-1
votes
0answers
18 views

Magento 2 How to use pattern validator js for frontend validation on attribute

In UpgradeData i added an attribute with email validation which works by setting the attribute frontend_class to the proper validator 'frontend_class' => 'validate-email', but with pattern i ...
0
votes
1answer
79 views

What is % in regular expression “%^/(test)-(.*?)-(.*?)$%”?

I am doing magento2 developer training. I am working on exercise"Create a new router which “understands” URLs like /frontNameactionPath- action and converts them to /frontName/actionPath/action". In ...
0
votes
1answer
327 views

Need to extend credit-card-type.js for master card detection and add new/latest regex pattern(resolved by myself)

Need to extend credit-card-type.js for add master card detection new/latest pattern: I am creating and extending payment method using this link http://inchoo.net/magento-2/implementing-payment-...
1
vote
1answer
1k views

Magento 2 - How to use pattern validation

I'm using a plugin to validate the street field (based on https://magento.stackexchange.com/a/158101/28803) and I want to use the validation method 'pattern' to test for the following regex: .*[0-9].*...
1
vote
2answers
648 views

RegEx in PHP file

I would like to place a RegEx Code in PHP code to validate a password. Example below of current code: if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) { $...
0
votes
1answer
28 views

Quantity adjustments for en_IN locale websites

When adjusting quantity on the product page or cart page to any quantity, Zend Framework isNumber() function fails to validate the number for numbers passed through in an en_IN locale website. As a ...
2
votes
4answers
310 views

how to display desktop theme on tablets, ipads?

I have used the following matched expression for mobile devices.. iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini Now mobile ...
0
votes
1answer
335 views

Minicart items count update

I'm using this extension: Ajax Cart Popup It works fine, but there is a problem of updating items counter which renders together with mini cart icon in the header. With original developers help on ...
4
votes
1answer
324 views

SUPEE6788 APPSEC-1063 SQL Injection

I've been looking around and haven't found any definitive heuristics to detect whether or not a code-base is affected, so I've resorted to performing a recursive file scan that matches a list of ...
1
vote
1answer
882 views

Adding multiple rewrites to config.xml

I'm trying to add a few url rewrites into the config.xml file in the "app/etc/" folder. I am not using the url rewrite function in magento itself because in need to be able to use regex. I tried the ...
1
vote
1answer
1k views

Can I use Regex in the URL Redirect section in Magentos backend?

Can I use Regex in the URL Redirect section in Magentos backend? Or any wildcards? Thanks
0
votes
2answers
67 views

Regex to Capture Text Between Rounded Bracket

Im having trouble to create the regex pattern (javascript) to capture the text between rounded bracket. Hereby the string value: var pattern = /->__\(([^)]+)\)/g; var value = "Line 54:'label' =>...
8
votes
3answers
2k views

Problem with Data URIs and CSS File Merge

Magento CSS file merge is pretending the hostname to my data-uris because the RegEx in Mage_Core_Model_Design_Package (beforeMergeCss) does not work as expected. It should prepend hostname to relative ...
1
vote
1answer
110 views

Magento custom cache clear by regex

Is it possible in Magento to allow for cache to be cleared in a custom code by using regular expression to target cache tags? The scenario I have is I am know of a list of cache tags I will be ...
0
votes
2answers
87 views

Analyse existing codebase for localization readiness

I have a recollection of seeing a tool or script that could analyse a legacy Magento project (custom theme and modules) to check for non-i18n code. The concept of a regex to find strings that are ...