Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Need a regular expression to check the first digit

by Anonymous Monk
on May 19, 2021 at 12:55 UTC ( #11132736=note: print w/replies, xml ) Need Help??


in reply to Need a regular expression to check the first digit

If you're looking for the first instance of the character '5' in a string of 9 numeric characters
index is your friend
my $var = '503009496'; my $i = index($var, '5');
I think that is what you are looking for.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11132736]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2022-05-29 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?