Python Forum
Facing issue in python regex newline match
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Facing issue in python regex newline match
#1
Hi Everyone,

.Myc PGGGGG_UIII_Q9999_AB A0 B11 B22 D1 D2 D3
+ 4I 3B

I am trying to match the above two line using regex.

\.(myc|Myc)\s+([a-zA-Z0-9\_\-]+)\s+(.*)\n(.*) = Used this regex

It will print --> .Myc PGGGGG_UIII_Q9999_AB A0 B11 B22 D1 D2 D3

It is not going to newline(\n is NOT WORKING HERE). Please let me know how to go to newline in python regex.
Suggestions are appreciated.

Thank you!
Reply


Messages In This Thread
Facing issue in python regex newline match - by Shr - Oct-12-2023, 08:54 AM
Python newline match - by Shr - Oct-13-2023, 10:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Last record in file doesn't write to newline gonksoup 3 494 Jan-22-2024, 12:56 PM
Last Post: deanhystad
  issue in using regex akbarza 4 609 Nov-14-2023, 10:00 AM
Last Post: buran
  Failing regex, space before and after the "match" tester_V 6 1,254 Mar-06-2023, 03:03 PM
Last Post: deanhystad
  Regex pattern match WJSwan 2 1,326 Feb-07-2023, 04:52 AM
Last Post: WJSwan
  Python Regex quest 2 2,434 Sep-22-2022, 03:15 AM
Last Post: quest
  Facing problem with Pycharm - Not getting the expected output amortal03 1 889 Sep-09-2022, 05:44 PM
Last Post: Yoriz
  Match substring using regex Pavel_47 6 1,491 Jul-18-2022, 07:46 AM
Last Post: Pavel_47
  CSV to Text File and write a line in newline atomxkai 4 2,773 Feb-15-2022, 08:06 PM
Last Post: atomxkai
  Facing Problem while opening a file through command prompt vlearner 4 1,980 Jan-30-2022, 08:10 AM
Last Post: snippsat
  Match key-value json,Regex saam 5 5,488 Dec-07-2021, 03:06 PM
Last Post: saam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020