AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / computer / Perguntas / 1789166
Accepted
Just Me
Just Me
Asked: 2023-06-15 15:38:49 +0800 CST2023-06-15 15:38:49 +0800 CST 2023-06-15 15:38:49 +0800 CST

REGEX: coloque todas as palavras de um parágrafo em uma única linha

  • 772

como visto abaixo, cada linha em todas as paráfrases está inacabada. As palavras no início de cada linha do parágrafo não são uma continuação da linha anterior. Estou interessado em conectar todas as linhas da paráfrase sem nenhuma quebra de palavra.

When the water rises up to F, the piece at A will be visible; when it
reaches G, both A and B will be visible; and when it comes up to H,
all three pieces will be visible.


_Artificial Earthquake and Volcano._

Grind an equal quantity of fresh iron filings with pure sulphur, till
the whole be reduced to a fine powder. Be careful not to let any wet
come near it. Then bury about thirty pounds of it a foot deep in the
earth, and in about six or eight hours the ground will heave and
swell, and shortly after send forth smoke and flames like a burning
mountain. If the earth is raised in a conical shape, it will be no bad
miniature resemblance of one of the burning mountains.


_Artificial Illuminations._

A very pleasing exhibition may be made with very little trouble or
expense, in the following manner: Provide a box, which you fit up with
architectural designs cut out on pasteboard; prick small holes in
those parts of the building where you wish the illuminations to
appear, observing, that in proportion to the perspective, the holes
are to be made smaller; and on the near objects the holes are to be
made larger. Behind these designs thus perforated, you fix a lamp or
candle, but in such a manner that the reflection of the light shall
only shine through the holes; then placing a light of just sufficient
brilliance to show the design of the buildings before it, and making a
hole for the sight at the front end of the box, you will have a very
tolerable representation of illuminated buildings.

A SAÍDA

When the water rises up to F, the piece at A will be visible; when it reaches G, both A and B will be visible; and when it comes up to H, all three pieces will be visible.


_Artificial Earthquake and Volcano._

Grind an equal quantity of fresh iron filings with pure sulphur, till the whole be reduced to a fine powder. Be careful not to let any wet come near it. Then bury about thirty pounds of it a foot deep in the earth, and in about six or eight hours the ground will heave and swell, and shortly after send forth smoke and flames like a burning mountain. If the earth is raised in a conical shape, it will be no bad miniature resemblance of one of the burning mountains.


_Artificial Illuminations._

A very pleasing exhibition may be made with very little trouble or expense, in the following manner: Provide a box, which you fit up with architectural designs cut out on pasteboard; prick small holes in those parts of the building where you wish the illuminations to appear, observing, that in proportion to the perspective, the holes are to be made smaller; and on the near objects the holes are to be made larger. Behind these designs thus perforated, you fix a lamp or candle, but in such a manner that the reflection of the light shall only shine through the holes; then placing a light of just sufficient brilliance to show the design of the buildings before it, and making a hole for the sight at the front end of the box, you will have a very tolerable representation of illuminated buildings.

Meu regex não funciona muito bem:

ENCONTRAR:^(.*?)$(\K.*)\r

SUBSTITUIR POR:\2

OU (um melhor)

ENCONTRAR:^(.*?)$(\R)

SUBSTITUIR POR:\1

notepad++
  • 3 3 respostas
  • 26 Views

3 respostas

  • Voted
  1. Best Answer
    Toto
    2023-06-15T16:41:02+08:002023-06-15T16:41:02+08:00

    Usando o Notepad++, pode ser que funcione com o SublimeText.


    • Ctrl+H
    • Encontrar o que:\R+_.+_\R+(*SKIP)(*FAIL)|\R
    • Substitua por: # Um espaço
    • TICK Envolver
    • SELECT Expressão regular
    • DESMARCAR . matches newline
    • Replace all

    Explicação:

    \R+         # 1 or more any kind of linebreak
    _.+_        # 1 or more any character surounded by underscores
    \R+         # 1 or more any kind of linebreak
    (*SKIP)     # skip this match
    (*FAIL)     # and considere it failed
    |           # OR
    \R          # any kind of linebreak
    

    Captura de tela (antes):

    insira a descrição da imagem aqui

    Captura de tela (depois):

    insira a descrição da imagem aqui

    • 1
  2. Rob Rob
    2023-06-16T04:54:44+08:002023-06-16T04:54:44+08:00

    Uma fórmula regex muito simples e útil:

    ENCONTRAR: ([^\r\n])\R([^\r\n])

    SUBSTITUIR POR: \1 \2

    • 0
  3. Just Me
    2023-06-16T19:11:16+08:002023-06-16T19:11:16+08:00
    • Ctrl+H
    • Encontrar o que:\R(?=.)
    • Substituir com:(leave empty)
    • VERIFICAR Envolver
    • VERIFICAR expressão regular
    • DESMARCAR . matches newline
    • Replace all
    • 0

relate perguntas

  • Mantenha o tipo/extensão de arquivo atual na caixa de diálogo "Salvar como..." do Notepad++

  • Contando vírgulas em uma string de texto e adicionando uma nova linha

  • Removendo informações

  • Notepad ++ excluir até dois pontos para cada linha com substituir tudo

  • NotePad++ User Defined Lang não mostra instruções condicionais

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Como posso reduzir o consumo do processo `vmmem`?

    • 11 respostas
  • Marko Smith

    Baixar vídeo do Microsoft Stream

    • 4 respostas
  • Marko Smith

    O Google Chrome DevTools falhou ao analisar o SourceMap: chrome-extension

    • 6 respostas
  • Marko Smith

    O visualizador de fotos do Windows não pode ser executado porque não há memória suficiente?

    • 5 respostas
  • Marko Smith

    Como faço para ativar o WindowsXP agora que o suporte acabou?

    • 6 respostas
  • Marko Smith

    Área de trabalho remota congelando intermitentemente

    • 7 respostas
  • Marko Smith

    O que significa ter uma máscara de sub-rede /32?

    • 6 respostas
  • Marko Smith

    Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows?

    • 1 respostas
  • Marko Smith

    O VirtualBox falha ao iniciar com VERR_NEM_VM_CREATE_FAILED

    • 8 respostas
  • Marko Smith

    Os aplicativos não aparecem nas configurações de privacidade da câmera e do microfone no MacBook

    • 5 respostas
  • Martin Hope
    Vickel O Firefox não permite mais colar no WhatsApp web? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke Por que os arquivos tar.xz são 15x menores ao usar a biblioteca tar do Python em comparação com o tar do macOS? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh Como posso reduzir o consumo do processo `vmmem`? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Pesquisa do Windows 10 não está carregando, mostrando janela em branco 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 Área de trabalho remota congelando intermitentemente 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney Por que colocar um ponto após o URL remove as informações de login? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca Todos os meus complementos do Firefox foram desativados repentinamente, como posso reativá-los? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK É possível criar um código QR usando texto? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 Altere o nome da ramificação padrão do git init 2019-04-01 06:16:56 +0800 CST

Hot tag

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve