and I am trying to see if $y starts with $x, but $y sometimes contains regex special characters like ()[], also ** which can give me errors.$x = "SERVER-NAME";
How can I safely check if $x at the start of $y?
is the current regex I am using.$y =~ /^$x/;
In reply to Regex on a variable with special characters by jaydee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |