I have got numbers like
l255677
l376039
l188144
l340482
l440700
l254113
to match the numbers starting with '13' what would be the regex
=~/13(.*)/ =======>This is not working ....
But for user123,user657
regex =~/user(.*)/ ========>works
Thanks for help..!!
Are you sure, that the first character in every line is '1'? I looks like 'I'. Feel the difference:'1'<>'I'
These are the numbers....
1255677
1376039
1188144
1340482
1440700
1254113
Thanks....
You might want to place a "^" at the start of the search criteria otherwise it just searches the whole string for the number 13.
So to search for number starting with 13 try this
=~/^13(.*)/
I don't want to be a nitpicker, but a bit more precise would be to use ^13\d*$
Going by the sample data, it probably should be:
/^13\d+$/
but maybe the sample data is not the same as the real data
trina_1:
I have got numbers like
l255677
l376039
l188144
l340482
l440700
l254113
to match the numbers starting with '13' what would be the regex
=~/13(.*)/ =======>This is not working ....
But for user123,user657
regex =~/user(.*)/ ========>works
Thanks for help..!!
non regex method, do a substring getting first 2 characters
if ( substr($line,0,2) == "13" ) {
....
}