Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: help with regex

by Marshall (Canon)
on Mar 20, 2019 at 05:26 UTC ( [id://1231476]=note: print w/replies, xml ) Need Help??


in reply to help with regex

Please post your desired output from your example.
Better yet is to show 2-3 examples and the desired output for each of them.

As far as I can tell there is only one string that is between a G(...)and 10+ more G's.
Update: shortened the very long string so it displays better.
Your question is not clear. Your code is not right.

Given the string: "GGCTTTCCGTTGTTGCTGGGTGTGGGGGGCGGGCGAGATTGGAAGAGCACA +CGTCTGAACTCCAGTCACG". "CCAATATCTCGTATGCCGTCTTCTGCTTGAAAAAAGGGGTGGGGGGGAGGGGGGGCGGGGGGGGGGGGG +GGAGGGGGGGAG", please explain in english what you want to accomplish. + I have no idea what this means

"ACTCCAGTCACGCCAATATCTCGTAT"  "[ACTG]{0,10}"  " .+"  "(G)\1{9,}   ".+ "
or how that relates to 10 G's or more in a row.

Update:
is this what you want?

#!/usr/bin/perl use strict; use warnings; while (my $line=<DATA>) { chomp $line; my @array = $line =~ /(ACTCCAGTCACGCCAATATCTCGTAT)(.+?)(?:G{10,})/ +g; print join ("\n", @array),"\n"; #prints "ACTCCAGTCACGCCAATATCTCGTAT" # "GCCGTCTTCTGCTTGAAAAAAGGGGTGGGGGGGAGGGGGGGC" -> stuff befo +re 10 or more G's } __DATA__ GGCTTTCCGTTGTTGCTGGGTGTGGGGGGCGGGCGAGATTGGAAGAGCACACGTCTGAACTCCAGTCACG +CCAATATCTCGTATGCCGTCTTCTGCTTGAAAAAAGGGGTGGGGGGGAGGGGGGGCGGGGGGGGGGGGG +GGAGGGGGGGAG

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found