skip to Main Content

Php – Bizarre preg_match_all() behavior

I have this code to process a config file: <?php $config = '[log] log_writers[] = "file" log_writers[] = "screen" [General] maintenance_mode = 0 enable_browser_archiving_triggering = 0 enable_sql_optimize_queries = 0 force_ssl = 1'; echo preg_match_all( '/^maintenance_mode[ t]*=[ t]*d$/m', $config ); The…

VIEW QUESTION

Javascript – Regex with OR condition

I have to create a regex to match exact string - /op , /kl , /xz Individual Regex works: new RegExp('/op').test("/op") new RegExp('/kl').test("/kl") new RegExp('/xz').test("/xz") How to merge this check into 1 Regex ? I tried new RegExp('(/op) | (/xz)').test("/op")…

VIEW QUESTION
Back To Top
Search