0

I am building a site in localhost. I am using WAMP server. When I use php 7.2.7, it's all running smoothly. But when I change it to 7.3.7, which is the current standard of my web host, the site on my pc is showing this error.

The code on that line is this:

protected static  function parseShortcodeAttrs($sc_tag){
    $attributes = (object)array();
    if(preg_match_all('/[\w-_]+="[^"]*"/', $sc_tag, $matches)!== false){
        if($matches){
            foreach ((array)$matches[0] as $attr) {
                if(preg_match('/([\w-_]+)="([^"]*)"/',$attr,$attrs)){
                    $attributes->{$attrs[1]} = $attrs[2];

Thank you in advance for your time in helping with this issue.

DarKMaSk
  • 1
  • 1
  • 1
    Does this answer your question? [preg\_match(): Compilation failed: invalid range in character class at offset](https://stackoverflow.com/questions/24764212/preg-match-compilation-failed-invalid-range-in-character-class-at-offset) – Akam Jan 05 '20 at 11:23
  • As Akam pointed out. This is a duplicate. You have `-` in the regex which should be `\-` since `-` means range when in-between `[]`. Meaning `[a-z]` is valid. – Andreas Jan 05 '20 at 11:30
  • @Akam : I am not very much conversant with such codes. But seeing that solution, I think there are some differences between that and of mine. So, I need the exact code i.e. what I have should write and where. – DarKMaSk Jan 05 '20 at 20:20
  • @Andreas: I haven't seen the other solution beforehand. But as I am not very conversant with coding, I need the exact solution i.e. what to write and where to write. Sorry for my lack of knowledge. Should I change [ \ w-_ ] to [ \-w_ ] ? – DarKMaSk Jan 05 '20 at 20:22

0 Answers0