PHP - explain REGEX expression -


Does anyone help me understand the following php regex expression I preg_match ("| store: (. * ) | ", $ K, $ matches) in PHP regex expressions '|' Represent?

  ... $ storevals = array (); Foreign currency ($ k = $ v as $ item) {if (preg_match ("| store: (. *) |", $ K, $ matches)) $ $ storevals [$ matches [1]] = $ V; }} ...  

The last CSV file of this function is to call the CSV header to change the keys in an array ( $ item ) I am trying to find out the format for the CSV file.

Thanks in advance.

Here's a complete explanation -

Store: Matches the letter "Store:" Really (case sensitive) 1 Capturing group (. *) (grouped by parentheses) . * matches any character (excluding new line) Quantifier: * between zero and unlimited time, return as often as possible, as needed [greedy]

Pipe | are the delimiter for regex.


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -