Regular expression – how to match two values, not depending on their corresponding position in the string

I am looking for the best way to match two values ​​at the same time.

If both values ​​are in the string, I want to get a true value, But I don’t know the order in which they appear in the string (e.g. abcdef or bedfa, in case I want to match a and b)

Is there a better solution (especially if I need to be more complicated in the future) To match) instead of:

$string =~ m/(a.*b)|(b.*a)/i

$string =~ /a/i && $string =~ /b/i;

< /div>

I am looking for the best way to match two values ​​at the same time.

If both values ​​are in the string, I want to get a true value, but I don’t know the order in which they appear in the string (e.g. abcdef or bedfa, in case I want to match a and b)

Is there a better solution (especially if I need more complex ones later) Value to match) instead of:

$string =~ m/(a.*b)|(b.*a)/i

$string =~ /a/i && $string =~ /b/i;

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5441 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.