[Chicago-talk] Can anyone help with a regex?

Alan Mead amead at alanmead.org
Wed Apr 3 10:36:05 PDT 2024


I think you need to escape a slash, but in the interest of teaching 
fishing, when I have this issue I use a regex debugger like this: 
https://regex101.com/

-Alan

On 4/3/24 12:33, Richard Reina wrote:
> I want to be able to find the sting 'ACCT/ID Number(s):'
>
> Here's what I've tried so far.
>
>
> my $line = "ACCT/ID Number(s): 1334356";
> my $d = "ACCT/ID Number(s):";
>
>
> if ($line =~ /\b$d(\s|$)/) {
>
>      print "Found $d in line\n";
>
> }
>
>   
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> https://mail.pm.org/mailman/listinfo/chicago-talk

-- 

Alan D. Mead, Ph.D.
President, Talent Algorithms Inc.

science + technology = better workers

https://talalg.com


He who confuses political liberty with freedom and political equality
with similarity has never thought for five minutes about either.

-- Shaw, from "Maxims for Revolutionists"




More information about the Chicago-talk mailing list